/* SMM interface inside Контент: the post editor, export, materials, history, the sheets they open.
   Ported from wt-smm/public/css/app.css. Everything is scoped under .smm-scope (hosts put <div class="smm-scope"> around the mounts;
   the sheet layer carries it itself) so it never fights Контент's own .btn/.field/.sheet/...; the few classes that clash in meaning
   are renamed: .cl-search -> .smm-search, .bar -> .smm-bar, body.panel-open -> body.smm-panel-open. Tokens come from tokens.css. */
.smm-scope .num { font-variant-numeric: tabular-nums; }
.smm-scope .ic { width: 17px; height: 17px; flex: none; }
.smm-scope .sub { color: var(--muted); font-size: 13px; }
.smm-scope .faint { color: var(--faint); }
.smm-scope .pad { padding: 14px; }
.smm-scope .h1 { margin: 0; font: 600 22px/1.2 var(--sans); letter-spacing: -.015em; }
.smm-scope .h2 { margin: 0; font: 600 15px/1.3 var(--sans); }
.smm-scope .loading { padding: 48px 24px; color: var(--faint); }
.smm-scope .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: transparent; font-weight: 500; font-size: 13px; white-space: nowrap; text-decoration: none; transition: background var(--t) var(--ease); }
.smm-scope .btn:hover { background: var(--raised); }
.smm-scope .btn:disabled { opacity: .5; cursor: default; }
.smm-scope .btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); font-weight: 600; }
.smm-scope .btn.primary:hover { opacity: .92; }
.smm-scope .btn.quiet { border-color: transparent; color: var(--muted); }
.smm-scope .btn.sm { height: 28px; font-size: 12px; padding: 0 10px; }
.smm-scope .btn .ic { width: 15px; height: 15px; }
.smm-scope .icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); border: 0; background: none; color: var(--muted); text-decoration: none; padding: 0; }
.smm-scope .icon-btn:hover { background: var(--raised); color: var(--text); }
.smm-scope .icon-btn:disabled { opacity: .4; cursor: default; }
.smm-scope .link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; padding: 4px 0; }
.smm-scope .link:hover { color: var(--text); }
.smm-scope .link .ic { width: 15px; height: 15px; }
.smm-scope .seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--sunken); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.smm-scope .seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.smm-scope .seg button.on { background: var(--raised); color: var(--text); box-shadow: var(--shadow-sm); }
.smm-scope .field { height: 38px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--sunken); width: 100%; font-size: 14px; }
.smm-scope textarea.field { height: auto; min-height: 64px; padding: 9px 12px; resize: vertical; line-height: 1.45; }
.smm-scope select.field { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.smm-scope .label { font-size: 12px; color: var(--muted); }
.smm-scope .chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap; }
.smm-scope .chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.smm-scope .chip-btn { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line-strong); background: var(--sunken); color: var(--text); font-size: 13px; white-space: nowrap; }
.smm-scope .chip-btn.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.smm-scope .card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.smm-scope .smm-bar { height: 5px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.smm-scope .smm-bar i { display: block; height: 100%; border-radius: 3px; background: var(--text); transition: width .3s var(--ease); }
.smm-scope .av { --c: #888; display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--c); color: #fff; font: 600 13px/1 var(--sans); }
.smm-scope .av.sm { width: 24px; height: 24px; border-radius: 6px; font-size: 10px; }
.smm-scope .av.big { width: 46px; height: 46px; border-radius: 12px; font-size: 15px; }
.smm-scope .empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 64px 24px; max-width: 460px; margin: 0 auto; }
.smm-scope .empty-ic { width: 54px; height: 54px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; color: var(--muted); }
.smm-scope .empty-ic .ic { width: 24px; height: 24px; }
.smm-scope .smm-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line); color: var(--faint); }
.smm-scope .smm-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 14px; }
.smm-scope .smm-search:focus-within { border-color: var(--line-strong); }
.smm-scope .smm-search.grow { flex: 1; min-width: 200px; }
.smm-scope .smm-search.big { height: 48px; border-radius: var(--r); }
.smm-scope .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.smm-scope .ph { background: linear-gradient(135deg, color-mix(in srgb, var(--c) 55%, var(--panel)), color-mix(in srgb, var(--c) 15%, var(--sunken))); }
.smm-scope .hist { padding: 8px 24px 24px; max-width: 760px; display: flex; flex-direction: column; }
.smm-scope .hrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 4px; border-top: 1px solid var(--line); text-decoration: none; }
.smm-scope .hrow:first-child { border-top: 0; }
.smm-scope .hr-go { margin-left: auto; color: var(--faint); }
.smm-scope .mat { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; padding: 6px 24px 90px; align-items: start; }
.smm-scope .mat-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.smm-scope .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.smm-scope .shoot { margin-bottom: 22px; }
.smm-scope .shoot h3 { margin: 0 0 10px; font: 600 15px/1.3 var(--sans); display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.smm-scope .shoot h3 .sub { font-weight: 400; }
.smm-scope .ph-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.smm-scope .ph-th { position: relative; aspect-ratio: 4 / 5; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--sunken); }
.smm-scope .ph-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.smm-scope .ph-th.sel { outline: 2px solid var(--text); outline-offset: -2px; }
.smm-scope .ph-th .lb { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; background: rgb(0 0 0 / .6); color: #fff; }
.smm-scope .ph-th .lb.bad { background: #C0412E; }
.smm-scope .ph-th .lb.cover { background: #B88A3A; }
.smm-scope .ph-th .ck { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #fff; background: rgb(0 0 0 / .25); color: transparent; display: grid; place-items: center; }
.smm-scope .ph-th .ck .ic { width: 12px; height: 12px; stroke-width: 3.2; }
.smm-scope .ph-th.sel .ck { background: var(--text); border-color: var(--text); color: var(--bg); }
.smm-scope .more-row { display: flex; justify-content: center; padding: 8px 0 16px; }
.smm-scope .mat-change { display: flex; gap: 18px; flex-wrap: wrap; }
.smm-scope .mat-side { padding: 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 76px; }
.smm-scope .side-h { display: flex; align-items: baseline; gap: 8px; }
.smm-scope .doc { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.smm-scope .doc-k { width: 36px; height: 40px; flex: none; border-radius: 6px; background: var(--raised); display: grid; place-items: center; font-size: 10px; font-weight: 600; color: var(--muted); }
.smm-scope .doc .t { display: flex; flex-direction: column; min-width: 0; }
.smm-scope .doc .t b { font-weight: 500; font-size: 13.5px; overflow-wrap: anywhere; }
.smm-scope .selbar { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-radius: 16px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); max-width: calc(100vw - 24px); flex-wrap: wrap; }
.smm-scope .selbar .sub { color: color-mix(in srgb, var(--bg) 70%, var(--text)); }
.smm-scope .selbar .btn { background: color-mix(in srgb, var(--bg) 16%, var(--text)); color: var(--bg); border-color: transparent; }
.smm-scope .selbar .link { color: var(--bg); }
.smm-scope .panel-scrim { position: fixed; inset: 0; z-index: 34; background: var(--scrim); }
.smm-scope .panel { position: fixed; z-index: 35; top: 0; right: 0; bottom: 0; width: min(1200px, calc(100vw - 260px)); background: var(--bg); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.smm-scope .ph-bar { flex: none; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.smm-scope .ph-ic .ic { width: 18px; height: 18px; color: var(--muted); }
.smm-scope .ph-t { font-weight: 600; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smm-scope .ph-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.smm-scope .ph-body { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 28px; padding: 20px 24px 28px; align-items: start; }
.smm-scope .pv-col { position: sticky; top: 0; }
.smm-scope .pv { display: flex; flex-direction: column; gap: 10px; }
.smm-scope .pv-note { text-align: center; margin: 0; font-size: 12.5px; }
.smm-scope .pv-slide { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--sunken); font-size: 13.5px; line-height: 1.4; }
.smm-scope .ig { background: #fff; color: #111; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.smm-scope .ig-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 14px; }
.smm-scope .ig-h .av.sm { background: var(--c); }
.smm-scope .ig-more { margin-left: auto; letter-spacing: 2px; color: #666; }
.smm-scope .ig-img { position: relative; aspect-ratio: 4 / 5; background: #eee; cursor: pointer; overflow: hidden; }
.smm-scope .ig-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.smm-scope .ig-empty { height: 100%; display: grid; place-items: center; color: #999; }
.smm-scope .ig-count { position: absolute; top: 10px; right: 10px; padding: 2px 8px; border-radius: 12px; background: rgb(0 0 0 / .6); color: #fff; font-size: 12px; }
.smm-scope .ig-cover { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 16px 16px; background: linear-gradient(to top, rgb(0 0 0 / .72), transparent); color: #fff; font: 700 24px/1.15 var(--sans); }
.smm-scope .ig-dots { display: flex; justify-content: center; gap: 5px; padding: 8px 0 0; }
.smm-scope .ig-dots i { width: 6px; height: 6px; border-radius: 50%; background: #ccc; }
.smm-scope .ig-dots i.on { background: #3B82F6; }
.smm-scope .ig-cap { padding: 8px 12px 14px; font-size: 13.5px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-line; }
.smm-scope .ig-cap.text-only { font-size: 15px; padding: 12px 14px 18px; }
.smm-scope .frame { position: relative; aspect-ratio: 9 / 16; width: min(100%, 300px); margin: 0 auto; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, #263648, #172230); }
.smm-scope .frame-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.smm-scope .zone { position: absolute; display: flex; padding: 6px 8px; font-size: 10.5px; color: #fff; background: repeating-linear-gradient(135deg, rgb(200 60 60 / .38) 0 6px, rgb(200 60 60 / .12) 6px 12px); border: 1px dashed rgb(255 120 100 / .8); }
.smm-scope .zone span { padding: 2px 7px; border-radius: 5px; background: rgb(18 18 18 / .78); line-height: 1.3; }
.smm-scope .zone.top { top: 0; left: 0; right: 0; height: 14%; align-items: flex-start; }
.smm-scope .zone.bottom { bottom: 0; left: 0; right: 0; height: 20%; align-items: flex-end; }
.smm-scope .zone.right { top: 38%; right: 0; width: 12%; height: 24%; writing-mode: vertical-rl; align-items: center; }
.smm-scope .frame-text { position: absolute; left: 7%; right: 16%; top: 28%; color: #fff; font: 700 26px/1.15 var(--sans); text-shadow: 0 2px 12px rgb(0 0 0 / .45); overflow-wrap: anywhere; }
.smm-scope .fl-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.smm-scope .f4 { display: grid; grid-template-columns: 1.1fr 1fr .8fr 1fr; gap: 10px; }
.smm-scope .fl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.smm-scope .fl .chip { align-self: flex-start; margin-top: 8px; }
.smm-scope .field.bad { border-color: var(--st-error); }
.smm-scope textarea.cap { overflow: hidden; resize: none; }
.smm-scope .field.strong { font-weight: 600; font-size: 15px; }
.smm-scope .cap-l { display: flex; justify-content: space-between; gap: 10px; }
.smm-scope .field.cap { min-height: 120px; }
.smm-scope .sls { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.smm-scope .sls:empty { display: none; }
.smm-scope .sl { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); }
.smm-scope .sl:first-child { border-top: 0; }
.smm-scope .sl.on { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.smm-scope .sl.over { background: var(--accent-soft); }
.smm-scope .sl.dragging { opacity: .4; }
.smm-scope .drag { color: var(--faint); cursor: grab; display: grid; place-items: center; }
.smm-scope .drag .ic { width: 14px; height: 14px; }
.smm-scope .sls.cover .sl-t, .smm-scope .sls.cover .sl-n, .smm-scope .sls.cover .drag, .smm-scope .sls.cover .chip { display: none; }
.smm-scope .sls.cover .sl { padding: 8px 10px; }
.smm-scope .sl-n { width: 16px; color: var(--faint); font-size: 13px; text-align: center; }
.smm-scope .sl-th { width: 48px; height: 60px; flex: none; border: 0; border-radius: 7px; overflow: hidden; background: var(--sunken); color: var(--faint); display: grid; place-items: center; padding: 0; }
.smm-scope .sl-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.smm-scope .sl-t { flex: 1; min-width: 0; min-height: 40px; overflow: hidden; border: 1px solid transparent; background: none; resize: none; padding: 6px 8px; border-radius: 7px; font-size: 14px; line-height: 1.35; }
.smm-scope .sl-t:hover, .smm-scope .sl-t:focus { background: var(--sunken); border-color: var(--line); outline: none; }
.smm-scope .w-rm { width: 28px; height: 28px; flex: none; border: 0; border-radius: 6px; background: none; color: var(--faint); display: inline-grid; place-items: center; padding: 0; }
.smm-scope .w-rm:hover { background: var(--raised); color: var(--text); }
.smm-scope .w-rm .ic { width: 14px; height: 14px; }
.smm-scope .w-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font-size: 13px; padding: 4px 0; }
.smm-scope .w-add:hover { color: var(--text); }
.smm-scope .w-add .ic { width: 14px; height: 14px; }
.smm-scope .sb { display: grid; grid-template-columns: 70px 1.4fr 1fr 28px; gap: 8px; margin-bottom: 8px; align-items: center; }
.smm-scope .board-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.smm-scope .dur { display: flex; align-items: center; gap: 8px; }
.smm-scope .dur .field { width: 90px; }
.smm-scope .tgs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; min-height: 42px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--sunken); }
.smm-scope .tg { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 10px; border-radius: 14px; border: 0; background: var(--raised); font-size: 13px; }
.smm-scope .tg .ic { width: 12px; height: 12px; }
.smm-scope .tg-in { flex: 1; min-width: 120px; height: 28px; border: 0; background: none; outline: none; padding: 0 6px; font-size: 13.5px; }
.smm-scope .ph-foot { flex: none; display: flex; align-items: center; gap: 20px; padding: 12px 24px; border-top: 1px solid var(--line); }
.smm-scope .ph-foot .saved { margin-left: auto; }
.layer.smm-scope { position: fixed; inset: 0; z-index: 70; background: var(--scrim); display: flex; justify-content: center; align-items: flex-start; padding: 56px 16px; overflow-y: auto; }
.smm-scope .sheet { width: 720px; max-width: 100%; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.smm-scope .sheet.narrow { width: 540px; }
.smm-scope .sheet.wide { width: 980px; }
.smm-scope .sheet-head { padding: 18px 22px 14px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line); }
.smm-scope .sheet-head .line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.smm-scope .sheet-head .line .sub { margin-left: auto; }
.smm-scope .sheet-body { padding: 4px 22px 14px; display: flex; flex-direction: column; }
.smm-scope .sheet-foot { padding: 12px 22px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); background: var(--sunken); flex-wrap: wrap; }
.smm-scope .sheet-foot .sub { flex: 1; min-width: 160px; }
.smm-scope .d-sec { padding: 14px 0 6px; font-size: 12px; color: var(--faint); }
.smm-scope .d-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 0; border-top: 1px solid var(--line); }
.smm-scope .d-row .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.smm-scope .cand { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.smm-scope .cand:hover b { color: var(--accent); }
.smm-scope .cand .t { display: flex; flex-direction: column; gap: 2px; }
.smm-scope .cand b { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.smm-scope .cand .ic { width: 15px; height: 15px; }
.smm-scope .pk-f { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.smm-scope .pk-f .smm-search { flex: 1; min-width: 200px; }
.smm-scope .pk-f select { width: auto; min-width: 180px; }
.smm-scope .pk-body { max-height: 60vh; overflow-y: auto; }
.smm-scope .pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; padding-top: 14px; }
.smm-scope .pk { position: relative; aspect-ratio: 4 / 5; padding: 0; border: 0; border-radius: 9px; overflow: hidden; background: var(--sunken); }
.smm-scope .pk img { width: 100%; height: 100%; object-fit: cover; display: block; }
.smm-scope .pk:hover { outline: 2px solid var(--accent); }
.smm-scope .pk-used { position: absolute; left: 5px; bottom: 5px; padding: 1px 6px; border-radius: 5px; font-size: 11px; background: rgb(0 0 0 / .6); color: #fff; }
.smm-scope .search-sheet { margin-top: 8vh; }
@media (max-width: 1180px) {
  .smm-scope .panel { width: min(1200px, calc(100vw - 80px)); }
  .smm-scope .ph-body { grid-template-columns: 320px minmax(0, 1fr); }
  .smm-scope .mat { grid-template-columns: minmax(0, 1fr); }
  .smm-scope .mat-side { position: static; }
}
@media (max-width: 860px) {
  .smm-scope .panel { width: 100vw; border-left: 0; }
  .smm-scope .panel-scrim { display: none; }
  .smm-scope .ph-bar { padding: 0 10px; gap: 8px; }
  .smm-scope .ph-bar #ed-date { display: none; }
  .smm-scope .ph-body { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 24px; gap: 18px; }
  .smm-scope .pv-col { position: static; }
  .smm-scope .frame { width: min(100%, 240px); }
  .smm-scope .f4 { grid-template-columns: 1fr 1fr; }
  .smm-scope .sb { grid-template-columns: 56px minmax(0, 1fr) 28px; }
  .smm-scope .sb input[data-k=on_screen] { grid-column: 1 / 3; grid-row: 2; }
  .smm-scope .ph-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); gap: 14px; flex-wrap: wrap; }
  .smm-scope .mat { padding: 6px 16px 100px; }
  .smm-scope .ph-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .smm-scope .hist { padding: 8px 16px 24px; }
  .layer.smm-scope { padding: 0; align-items: flex-end; }
  .smm-scope .sheet, .smm-scope .sheet.narrow, .smm-scope .sheet.wide { width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92vh; overflow-y: auto; }
  .smm-scope .search-sheet { margin-top: 0; }
  .smm-scope .selbar { bottom: calc(72px + env(safe-area-inset-bottom)); }
}
.smm-scope .dd { position: relative; }
.smm-scope .dd-b { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; padding-right: 10px; }
.smm-scope .dd-v { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; }
.smm-scope .dd-v .ic { color: var(--muted); }
.smm-scope .dd-ch { width: 14px; height: 14px; color: var(--muted); }
.smm-scope .dd-b[aria-expanded="true"] { border-color: var(--muted); }
.smm-scope .dd-b > .ic { width: 15px; height: 15px; color: var(--muted); }
.smm-scope .dd-m { position: absolute; z-index: 40; top: 44px; left: 0; min-width: 100%; padding: 5px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--raised); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.smm-scope .dd-o { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: none; text-align: left; white-space: nowrap; }
.smm-scope .dd-o:hover { background: var(--sunken); }
.smm-scope .dd-o.on { background: var(--sunken); }
.smm-scope .dd-o .ic { color: var(--muted); }
.smm-scope .cal { position: absolute; z-index: 40; top: 44px; left: 0; width: 280px; padding: 10px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--raised); box-shadow: var(--shadow); }
.smm-scope .cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.smm-scope .cal-w, .smm-scope .cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.smm-scope .cal-w span { font-size: 11.5px; color: var(--faint); padding: 4px 0; }
.smm-scope .cal-d { height: 34px; border: 0; border-radius: 8px; background: none; font-size: 13.5px; }
.smm-scope .cal-d:hover { background: var(--sunken); }
.smm-scope .cal-d.today { color: var(--accent); font-weight: 600; }
.smm-scope .cal-d.on { background: var(--primary); color: var(--primary-ink); }
@media (max-width: 860px) {
  .smm-scope .dd-m, .smm-scope .cal { top: 44px; }
  .smm-scope .cal { width: min(280px, calc(100vw - 40px)); }
}
.smm-scope .banner { --bc: var(--accent); display: flex; align-items: center; gap: 14px; margin: 0 24px 14px; padding: 14px 16px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--bc) 38%, transparent); background: color-mix(in srgb, var(--bc) 10%, var(--panel)); }
.smm-scope .banner.warn { --bc: var(--st-publishing); }
.smm-scope .banner.bad { --bc: var(--st-error); }
.smm-scope .banner.info { --bc: var(--st-ready); }
.smm-scope .bn-ic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; color: var(--bc); }
.smm-scope .bn-ic .ic { width: 20px; height: 20px; }
.smm-scope .bn-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.smm-scope .bn-t b { font-weight: 600; }
.smm-scope .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--st-ready); animation: smm-spin .8s linear infinite; }
@keyframes smm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .smm-scope .spin { animation: none; }
}
.smm-scope .ph-foot { flex-direction: column; align-items: stretch; gap: 10px; }
.smm-scope .redo { display: flex; flex-direction: column; gap: 10px; }
.smm-scope .redo-r1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.smm-scope .redo-r1 .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.smm-scope .redo-q { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.smm-scope .redo-r2 { display: flex; gap: 12px; }
.smm-scope .redo-r2 .field { height: 44px; }
.smm-scope .redo-r2 .btn { height: 44px; padding: 0 18px; }
.smm-scope .redo.off .redo-r1, .smm-scope .redo.off .redo-r2 { opacity: .55; }
.smm-scope .redo-note { margin: 0; }
.smm-scope .chip-btn:disabled { opacity: .5; cursor: default; }
.smm-scope .ph-links { display: flex; align-items: center; gap: 20px; }
.smm-scope .ph-links .saved { margin-left: auto; }
.smm-scope .sl-no { font-size: 10.5px; line-height: 1.15; color: var(--muted); text-align: center; padding: 0 3px; }
.smm-scope .sl-th { flex-direction: column; gap: 3px; }
.smm-scope .tagline { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); }
.smm-scope .tagline .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.smm-scope .tagline .smm-bar i { background: var(--st-ready); }
.smm-scope .tagline .pct { color: var(--faint); font-size: 13px; }
.smm-scope .chips.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.smm-scope .chip-btn .num { color: var(--faint); margin-left: 4px; }
.smm-scope .chip-btn.on .num { color: inherit; opacity: .7; }
@media (max-width: 760px) {
  .smm-scope .banner { margin-left: 16px; margin-right: 16px; }
  .smm-scope .banner { flex-wrap: wrap; }
  .smm-scope .redo-r1 { gap: 8px; }
  .smm-scope .redo-q { margin-left: 0; }
  .smm-scope .redo-r2 { flex-direction: column; }
  .smm-scope .redo-r2 .btn { width: 100%; }
  .smm-scope .ph-links { flex-wrap: wrap; gap: 14px; }
}
.smm-scope .xp { padding: 8px 24px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 1100px; }
.smm-scope .xp-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.smm-scope .xp-h .h1 { font-size: 20px; }
.smm-scope .xp .banner { margin: 0; }
.smm-scope .xl { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.smm-scope .xr { display: grid; grid-template-columns: 92px 64px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
.smm-scope .xr:first-child { border-top: 0; }
.smm-scope .xr:has(.xr-pick) { grid-template-columns: 24px 92px 64px minmax(0, 1fr) minmax(0, 300px); }
.smm-scope .xr.done { background: color-mix(in srgb, var(--st-published) 6%, var(--panel)); }
.smm-scope .xr-d { display: flex; flex-direction: column; gap: 2px; }
.smm-scope .xr-d b { font-size: 15px; font-weight: 600; }
.smm-scope .xr-th { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--sunken); }
.smm-scope .xr-th img, .smm-scope .xr-th .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.smm-scope .xr-t { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.smm-scope .xr-t b { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.smm-scope .xr-a { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.smm-scope .xr-ck { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.smm-scope .xr-ck input, .smm-scope .xr-pick input, .smm-scope .src-ck input { width: 17px; height: 17px; accent-color: var(--primary); }
.smm-scope .xr-r { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; font-size: 13px; }
.smm-scope .xr-ok { color: var(--st-published); font-weight: 500; }
.smm-scope .xr-bad { color: var(--st-error); line-height: 1.35; }
.smm-scope .xp-foot { display: flex; justify-content: flex-end; }
.smm-scope .srcs { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.smm-scope .src { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); }
.smm-scope .src:first-child { border-top: 0; }
.smm-scope .src.ok { background: color-mix(in srgb, var(--st-published) 7%, transparent); }
.smm-scope .src-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.smm-scope .src-t b { font-weight: 500; }
.smm-scope .src-t a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.smm-scope .src-t a .ic { width: 13px; height: 13px; }
.smm-scope .src-no { color: var(--st-error); font-size: 12.5px; }
.smm-scope .src-ck { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
@media (max-width: 760px) {
  .smm-scope .xp { padding: 8px 16px 40px; }
  .smm-scope .xr, .smm-scope .xr:has(.xr-pick) { grid-template-columns: 56px minmax(0, 1fr); gap: 10px 12px; }
  .smm-scope .xr:has(.xr-pick) .xr-pick { grid-column: 1; grid-row: 1; }
  .smm-scope .xr .xr-d { grid-column: 2; }
  .smm-scope .xr .xr-th { display: none; }
  .smm-scope .xr-t, .smm-scope .xr-a, .smm-scope .xr-r { grid-column: 1 / -1; }
  .smm-scope .xr-a { justify-content: flex-start; }
  .smm-scope .xp-foot .btn { width: 100%; }
}
.smm-scope .xp-foot { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.smm-scope .mat-title { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.smm-scope .mat-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.smm-scope .mat-filters select.field { width: auto; max-width: min(100%, 340px); }
.smm-scope .tagline.slim { padding: 8px 14px; margin-bottom: 12px; gap: 12px; }
.smm-scope .tagline.slim .t { gap: 4px; }
.smm-scope .tagline.slim .tl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; }
.smm-scope .tagline.slim .smm-bar { height: 3px; }
.smm-scope .tagline.slim.bad { border-color: color-mix(in srgb, var(--st-error) 40%, var(--line)); }

/* ---------- hooks for the host, plus the bits the generator cannot see ---------- */
body.smm-panel-open { overflow: hidden; }
.smm-scope #smm-ed-extra-top { flex: none; }
.smm-scope #smm-ed-extra-top:empty, .smm-scope #smm-ed-extra-rules:empty { display: none; }
.smm-scope textarea[name=theses], .smm-scope textarea[name=title] { overflow: hidden; resize: none; }
.smm-scope textarea[name=title] { min-height: 38px; padding-top: 8px; padding-bottom: 8px; line-height: 1.35; }
.smm-scope [hidden] { display: none !important; }
