/* W&T Studio · planner. Dark graphite + gold; light paper + terracotta. */
:root {
  --bg: #0E0E0D;
  --panel: #161614;
  --raised: #1D1D1A;
  --sunken: #121211;
  --line: #262522;
  --line-strong: #34322D;
  --text: #EFEFEB;
  --muted: #9A9791;
  --faint: #85827B;
  --accent: #C4A97D;
  --accent-hi: #D6BE96;
  --accent-ink: #14120E;
  --accent-soft: rgb(196 169 125 / .12);
  --accent-line: rgb(196 169 125 / .42);
  --scrim: rgb(6 6 5 / .62);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .35);
  --shadow: 0 2px 6px rgb(0 0 0 / .28), 0 18px 48px rgb(0 0 0 / .38);
  --st-draft: #8C8983;
  --st-ready: #7E98B8;
  --st-scheduled: #C4A97D;
  --st-publishing: #C9935A;
  --st-published: #86A580;
  --st-error: #C8695C;
  --r: 14px;
  --r-sm: 12px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --t: 200ms;
  --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --sans: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --rail-w: 236px;
  --series-1: #d95926; /* charts: orange — validated on the dark surface */
  --series-2: #3987e5; /* charts: blue */
  color-scheme: dark;
}
:root[data-theme="light"] {
  --series-1: #eb6834;
  --series-2: #2a78d6;
  --bg: #F2EFE8;
  --panel: #F8F6F1;
  --raised: #FFFFFF;
  --sunken: #EAE6DD;
  --line: #E0DBD0;
  --line-strong: #CFC8BA;
  --text: #1F1D1A;
  --muted: #6B665E;
  --faint: #736D63;
  --accent: #A4472B;
  --accent-hi: #B85636;
  --accent-ink: #FFFFFF;
  --accent-soft: rgb(164 71 43 / .09);
  --accent-line: rgb(164 71 43 / .38);
  --scrim: rgb(40 34 26 / .32);
  --shadow-sm: 0 1px 2px rgb(60 45 25 / .08);
  --shadow: 0 2px 6px rgb(60 45 25 / .06), 0 18px 44px rgb(60 45 25 / .13);
  --st-draft: #8D877D;
  --st-ready: #4F74A3;
  --st-scheduled: #A07E45;
  --st-publishing: #B9762F;
  --st-published: #4F8A4A;
  --st-error: #B4472F;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
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); 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: 76px; aspect-ratio: 158 / 70; background: var(--accent);
  -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 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  cursor: pointer; white-space: nowrap; font-weight: 500;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), transform var(--t) var(--ease), opacity var(--t);
}
.btn:hover { border-color: var(--line-strong); background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.gold { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.gold:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn.gold kbd { border-color: currentColor; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn.quiet:hover { background: var(--panel); 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: 42px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.icon-btn { width: 36px; padding: 0; }
.icon-btn.sm { width: 30px; height: 30px; }

.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: 40px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); 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); background: var(--panel); box-shadow: 0 0 0 3px 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: 11px; background: var(--sunken); border: 1px solid var(--line); }
.seg button { height: 28px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 500; 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: var(--shadow-sm); }
.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 9px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--st); background: color-mix(in srgb, var(--st) 13%, 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(--accent); border: 1px solid var(--accent-line); }

/* ---------- 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: 18px; box-shadow: var(--shadow); }
.auth-logo { width: 92px; margin: 0 auto 4px; }
.auth-card h1 { font: 500 30px/1.1 var(--serif); text-align: center; margin: 0; letter-spacing: -.01em; }
.auth-card h1 em, .bar-title h1 em, .empty h2 em, .set-sec h2 em { color: var(--accent); font-style: italic; }
.auth-card p.muted { text-align: center; margin: -6px 0 6px; font-size: 13px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100%; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 26px 16px 18px; background: var(--panel); border-right: 1px solid var(--line); }
.rail-logo { display: block; padding: 0 10px; width: max-content; }
.acct { position: relative; }
.acct-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--sunken); cursor: pointer; text-align: left; transition: border-color var(--t) var(--ease); }
.acct-btn:hover { border-color: var(--line-strong); }
.acct-name { display: grid; min-width: 0; line-height: 1.25; flex: 1; }
.acct-name b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-name small { color: var(--muted); font-size: 11px; }
.acct-chev { color: var(--muted); }
.acct-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; padding: 6px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.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; }

.nav { display: grid; gap: 2px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--muted); text-decoration: none; cursor: pointer; font-weight: 500; width: 100%; text-align: left; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.nav-item:hover { color: var(--text); background: var(--sunken); }
.nav-item.on { color: var(--text); background: var(--raised); box-shadow: var(--shadow-sm); }
.nav-item.on .ico { color: var(--accent); }
.nav-item .count { margin-left: auto; font-size: 11px; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--st-error) 20%, transparent); color: var(--st-error); }
.rail-foot { margin-top: auto; display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-height: 76px; padding: 14px 32px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.bar-title { min-width: 0; }
.bar-title h1 { margin: 0; font: 500 30px/1.05 var(--serif); letter-spacing: -.01em; white-space: nowrap; }
.bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.next-up { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px 0 4px; border-radius: 20px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--text); text-decoration: none; font-size: 12.5px; cursor: pointer; transition: border-color var(--t) var(--ease), background var(--t); }
.next-up:hover { border-color: var(--accent); }
.next-up img, .next-up .nu-blank { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--sunken); }
.next-up b { font-weight: 500; color: var(--accent); }
.next-up .nu-text { display: grid; line-height: 1.15; }
.next-up small { color: var(--muted); font-size: 11px; }
.view { flex: 1; padding: 28px 32px 48px; outline: none; }
.mobile-only { display: none !important; }

/* ---------- calendar ---------- */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 24px; align-items: start; }
.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: 500; color: var(--muted); height: 24px; min-width: 24px; display: inline-grid; place-items: center; align-self: flex-start; border-radius: 12px; }
.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(--accent-line); background: var(--panel); color: var(--accent); 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(--accent); color: var(--accent-ink); }
.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; }
.cal.week .day { min-height: calc(100vh - 230px); padding: 12px 10px; }
.cal.week .pc { flex-direction: column; align-items: stretch; padding: 6px 6px 10px; }
.cal.week .pc .th { width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 6px; }
.cal.week .pc-body { padding: 2px 2px 0; }
.cal.week .pc-cap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.cal.week .day-add { opacity: .7; transform: none; }
.week-label { display: none; }
.cal.week.is-empty .day { min-height: 180px; }
.week-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 6px; padding: 36px 24px 40px; text-align: center; border-top: 1px solid var(--line); }
.week-empty b { font: 500 24px/1.2 var(--serif); }
.week-empty b em { color: var(--accent); }
.week-empty span { color: var(--muted); font-size: 13px; }

.side-col h3 { font: 500 20px/1.2 var(--serif); margin: 4px 0 4px; }
.side-col h3 em { color: var(--accent); }
.side-col p { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }
.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: 500 26px/1.15 var(--serif); }
.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(--accent-line); background: linear-gradient(var(--accent-soft), 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: 500 34px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.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); font-style: italic; }
.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-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.lib-tools .sel-bar { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.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: 500 26px var(--serif); }
.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: 500 22px/1.2 var(--serif); }
.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: 500 26px/1 var(--serif); }
.ed-head h2 em { color: var(--accent); }
.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)); }
.sheet { position: fixed; inset: auto 0 0; z-index: 70; padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); background: var(--raised); border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; box-shadow: var(--shadow); transform: translateY(100%); transition: transform 260ms var(--ease); }
.sheet.open { transform: none; }
.sheet .grab { width: 40px; height: 4px; border-radius: 3px; background: var(--line-strong); margin: 2px auto 10px; }
.tabbar { display: none; }

/* ---------- 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) {
  .next-up .nu-text small { display: none; }
  .editor { grid-template-columns: minmax(0, 1fr) 340px; }
  .phone { width: 300px; }
}
@media (max-width: 900px) {
  :root { --rail-w: 76px; }
  .rail { padding: 22px 10px; align-items: center; }
  .rail-logo .logo-mask { width: 48px; }
  .rail .acct-name, .rail .acct-chev, .nav-item span:not(.count) { display: none; }
  .acct-btn { justify-content: center; padding: 6px; border: 0; background: transparent; }
  .acct-menu { width: 240px; }
  .nav-item { justify-content: center; padding: 0; width: 48px; }
  .nav-item .count { position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .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; }
  .shell { grid-template-columns: 1fr; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .rail { display: none; }
  .mobile-only { display: inline-flex !important; }
  .bar { min-height: 0; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; gap: 10px; }
  .bar-title h1 { font-size: 26px; }
  .bar-end { gap: 8px; }
  #new-post { display: none; }
  .next-up { height: 34px; gap: 8px; padding: 0 10px 0 3px; font-size: 12px; }
  .next-up .nu-text small { display: none; }
  .bar-actions { order: 3; width: 100%; }
  .view { padding: 16px 16px 32px; }
  .tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tab { display: grid; justify-items: center; gap: 3px; padding: 6px 0; border: 0; background: transparent; color: var(--muted); font-size: 10.5px; text-decoration: none; cursor: pointer; position: relative; }
  .tab .ico { width: 22px; height: 22px; }
  .tab.on { color: var(--text); }
  .tab.on .ico { color: var(--accent); }
  .tab .count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; font-size: 9.5px; display: grid; place-items: center; background: var(--st-error); color: #fff; }
  .tab-new { justify-self: center; width: 50px; height: 50px; margin-top: -18px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); cursor: pointer; }
  .tab-new .ico { width: 24px; height: 24px; stroke-width: 2; }
  .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: 500 22px var(--serif); }
  .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; }
  .cal.week { border: 0; background: transparent; overflow: visible; }
  .cal.week .cal-head { display: none; }
  .cal.week .cal-grid { grid-template-columns: 1fr; gap: 10px; }
  .cal.week .day { min-height: 0; border: 1px solid var(--line) !important; border-radius: var(--r-sm); background: var(--panel); align-items: stretch; padding: 10px; }
  .cal.week .day.today { box-shadow: none; border-color: var(--accent-line) !important; }
  .cal.week .day.today .week-label { color: var(--accent); }
  .cal.week .week-label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
  .cal.week .week-label small { color: var(--muted); font-weight: 400; }
  .cal.week .dnum { display: none; }
  .cal.week .pc { flex-direction: row; align-items: center; padding: 6px; }
  .cal.week .pc .th { width: 40px; height: 50px; aspect-ratio: auto; }
  .cal.week .day-add { display: grid; opacity: 1; top: 8px; }
  .cal.week.is-empty .day { min-height: 0; }
  .cal.week .week-empty { order: -1; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); padding: 22px 16px; }
  .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: 28px; }
  .filters select { flex: 1 1 40%; min-width: 0; }
  .lib-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .lib-tools .sel-bar { margin-left: 0; width: 100%; }
  .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(--accent); border: 1px solid var(--accent-line); 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(--accent); }
.t-head > div { display: grid; gap: 3px; }
.t-head b { font: 500 22px/1.1 var(--serif); }
.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: 500 26px/1.15 var(--serif); }
.stats-head h2 em { color: var(--accent); font-style: italic; }
.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; }
@media (max-width: 900px) {
  .trow.vk-row { grid-template-columns: 52px minmax(0, 1fr); row-gap: 6px; }
  .vk-row > .tnum { grid-column: 2; display: flex; justify-content: space-between; font-size: 13px; }
  .vk-row > .tnum::before { content: attr(data-label); color: var(--muted); }
  .vk-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: 500 22px/1.1 var(--serif); font-variant-numeric: lining-nums 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: 500 21px/1.15 var(--serif); }
.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: 500 26px/1.15 var(--serif); }
.pf-head h2 em { color: var(--accent); font-style: italic; }
.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 { flex-basis: 100%; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 0; padding: 5px 5px 7px; }
.pf-bar::-webkit-scrollbar { display: none; }
/* Platform buttons: solid, in each network's colours, raised like a key (top highlight, a darker bottom edge);
   the chosen one is pressed in. --pf-bg the face, --pf-edge the bottom edge, --pf-ink text and icons. */
.pf-btn { --pf-bg: var(--accent); --pf-edge: color-mix(in srgb, var(--accent) 65%, #000); --pf-ink: var(--accent-ink); --pf-ring: rgb(255 255 255 / .9);
  position: relative; display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 16px 0 6px; border-radius: 999px;
  border: 1px solid rgb(0 0 0 / .14); color: var(--pf-ink); font: 600 14px var(--sans); letter-spacing: .01em; cursor: pointer; white-space: nowrap;
  background: linear-gradient(180deg, rgb(255 255 255 / .2), rgb(255 255 255 / .04) 48%, rgb(0 0 0 / .08)), var(--pf-bg);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), 0 3px 0 var(--pf-edge), 0 5px 10px rgb(0 0 0 / .18);
  text-shadow: 0 1px 0 rgb(0 0 0 / .18); margin: 0 0 4px; transform: translateY(0);
  transition: transform 90ms var(--ease), box-shadow 90ms var(--ease), filter var(--t) var(--ease); }
.pf-btn:hover { filter: brightness(1.07) saturate(1.05); }
.pf-btn:active, .pf-btn.on { transform: translateY(3px);
  background: linear-gradient(180deg, rgb(0 0 0 / .2), rgb(0 0 0 / .05) 55%, rgb(255 255 255 / .06)), var(--pf-lit, var(--pf-bg));
  box-shadow: inset 0 4px 9px rgb(0 0 0 / .42), inset 0 -1px 0 rgb(255 255 255 / .18), 0 0 0 var(--pf-edge); }
/* The chosen one: pressed in, darker, ringed; the rest step back a little. */
.pf-btn.on { filter: none; outline: 2px solid var(--pf-lit-edge, var(--pf-edge)); outline-offset: 2px; }
.pf-bar:has(.pf-btn.on) .pf-btn:not(.on) { filter: saturate(.75) brightness(.97); opacity: .82; }
.pf-bar:has(.pf-btn.on) .pf-btn:not(.on):hover { filter: none; opacity: 1; }
.pf-btn .ava.xs { width: 30px; height: 30px; box-shadow: 0 0 0 2px var(--pf-ring), 0 1px 3px rgb(0 0 0 / .3); }
.pf-btn .pf-ava.xs { border: 0; background: rgb(255 255 255 / .22); color: var(--pf-ink); }
.pf-btn .pf-ava.xs .ico { width: 15px; height: 15px; stroke-width: 1.9; }
.pf-btn .pf-ava.pf-all.xs { padding: 4px; background: rgb(0 0 0 / .1); }
.pf-btn .pf-ava.pf-all.xs .ico { width: 9px; height: 9px; }
.pf-btn .pf-dot { background: var(--pf-ink); box-shadow: 0 0 0 2px rgb(0 0 0 / .12); }
.pf-btn .pf-dot.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--pf-ink); opacity: .75; }
/* Network colours, muted to sit with graphite and paper. */
.pf-btn[data-pf="instagram"] { --pf-bg: linear-gradient(115deg, #74559F 0%, #A65380 45%, #BE5E78 68%, #C88466 100%); --pf-edge: #6E3550; --pf-ink: #fff;
  --pf-lit: linear-gradient(115deg, #6E3BD9 0%, #C13584 42%, #E1306C 66%, #F77737 100%); --pf-lit-edge: #C13584; }
.pf-btn[data-pf="telegram"] { --pf-bg: #4E93B8; --pf-edge: #33657F; --pf-ink: #fff; --pf-lit: #229ED9; --pf-lit-edge: #229ED9; }
.pf-btn[data-pf="vk"] { --pf-bg: #4A78B8; --pf-edge: #32527F; --pf-ink: #fff; --pf-lit: #0077FF; --pf-lit-edge: #0077FF; }
.pf-btn[data-pf="youtube"] { --pf-bg: #B9484F; --pf-edge: #7E2F35; --pf-ink: #fff; --pf-lit: #FF0033; --pf-lit-edge: #FF0033; }
.pf-btn[data-pf="tiktok"] { --pf-bg: #2A2928; --pf-edge: #111; --pf-ink: #fff; border-color: #5FBDBA #C25A6E #C25A6E #5FBDBA; --pf-lit: #121212; --pf-lit-edge: #FE2C55; }
.pf-btn[data-pf="tiktok"].on { border-color: #25F4EE #FE2C55 #FE2C55 #25F4EE; }
.pf-btn[data-pf="threads"] { --pf-bg: #F2EFE8; --pf-edge: #B5AFA3; --pf-ink: #1F1D1A; --pf-ring: rgb(0 0 0 / .75); text-shadow: none; --pf-lit: #fff; --pf-lit-edge: #000; }
.pf-btn[data-pf="all"] { --pf-lit: var(--accent-hi); --pf-lit-edge: var(--accent); }
.pf-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ava.xs { width: 22px; height: 22px; }
.pf-ava.xs .ico { width: 12px; height: 12px; }
.pf-ava.pf-all.xs { padding: 3px; }
.pf-ava.pf-all.xs .ico { width: 7px; height: 7px; }
.pf-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--st-published); flex: none; }
.pf-dot.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
@media (max-width: 700px) {
  .pf-bar { order: 4; margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); flex-basis: auto; }
}
.auth-legal { margin: 4px 0 0; text-align: center; font-size: 12px; color: var(--faint); } .auth-legal a { color: var(--muted); }
/* YouTube statistics */
.trow.yt-row { grid-template-columns: 88px minmax(0, 1fr) 84px 80px 90px 70px 60px 70px 24px; gap: 12px; }
.trow .th.wide { width: 88px; height: 50px; }
.pd-head.yt { grid-template-columns: 280px minmax(0, 1fr); }
.pd-thumb.wide { width: 280px; aspect-ratio: 16 / 9; }
@media (max-width: 900px) {
  .trow.yt-row { grid-template-columns: 88px minmax(0, 1fr); row-gap: 6px; }
  .yt-row > .tnum { grid-column: 2; display: flex; justify-content: space-between; font-size: 13px; }
  .yt-row > .tnum::before { content: attr(data-label); color: var(--muted); }
  .yt-row > .go { display: none; }
}
@media (max-width: 700px) {
  .pd-head.yt { grid-template-columns: 1fr; }
  .pd-thumb.wide { width: 100%; }
}
.cover-916.wide { aspect-ratio: 16 / 9; }
.manual-box { padding: 14px 16px; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--st-publishing) 45%, transparent); background: color-mix(in srgb, var(--st-publishing) 8%, transparent); }
.manual-box .lbl span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.manual-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.manual-actions a.btn { text-decoration: none; }
.manual-box .ed-row { display: flex; gap: 8px; }
.manual-box .ed-row input { flex: 1; }
.auth-legal { line-height: 1.6; } .auth-legal .yt-brand { color: #FF0000; font-weight: 600; }

/* ---------- messages ---------- */
.nav-item .count.new, .tab .count.new { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.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(--accent-line); background: var(--accent-soft); color: var(--accent); }
.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: 500 21px/1.2 var(--serif); 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(--accent-line); background: var(--accent-soft); color: var(--accent); }
.au-sec { margin-top: 28px; }
.au-sec h3 { margin: 0 0 12px; font: 500 22px/1.2 var(--serif); }
.au-sec h3 em, .au-form h2 em, .set-sec h2 em { color: var(--accent); font-style: italic; }
.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: 500 30px/1.1 var(--serif); }
.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: 500 22px/1.15 var(--serif); }
.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: 500 26px/1 var(--serif); font-feature-settings: "lnum" 1, "tnum" 1; }
.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: 500 25px/1.15 var(--serif); letter-spacing: -.01em; 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); }
.lib-sec { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 500; letter-spacing: .02em; }
.lib-sec:first-child { margin-top: 0; }
.lib-sec .ico { width: 15px; height: 15px; }
.lib-sec small { color: var(--faint); font-variant-numeric: tabular-nums; }
.mtile.cgroup .img { overflow: visible; }
.mtile.cgroup .img::before, .mtile.cgroup .img::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-sm); background: var(--raised); border: 1px solid var(--line-strong); z-index: -1; transition: transform var(--t) var(--ease); }
.mtile.cgroup .img::before { transform: translate(5px, -5px); }
.mtile.cgroup .img::after { transform: translate(10px, -10px); opacity: .6; }
.mtile.cgroup { isolation: isolate; }
.cg-open { margin-left: auto; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; }
.cg-open:hover { text-decoration: underline; }
.cg-files { grid-column: 1 / -1; display: grid; gap: 10px; padding: 12px; border-radius: var(--r); border: 1px dashed var(--line-strong); background: var(--sunken); }
.cg-files > span { font-size: 12.5px; }
.mtile.cgroup { overflow: visible; }
.mtile.cgroup .img img { border-radius: var(--r-sm) var(--r-sm) 0 0; }

/* ---------- 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: 500 19px/1.25 var(--serif); }
.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: 500 34px/1.15 var(--serif); 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: 500 18px/1.2 var(--serif); }
.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 */
.st { position: absolute; inset: 0; background: #000; }
.st > img, .st > 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 .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; }

/* Back to the studio home on phones (the rail with «Студия W&T» is hidden there). */
.studio-back { display: none; align-items: center; height: 32px; padding: 0 12px 0 10px; border-radius: 16px; border: 1px solid var(--line-strong);
  color: var(--accent); font: 500 13px var(--sans); text-decoration: none; white-space: nowrap; flex: none; }
