/* Новини ТСН (18.11.2026): редактор і перегляд «як у Discord». Кольори Discord — з його тем (темна / світла). */

/* ───────── список ───────── */
.nw-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.nw-search { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.nw-search input { flex: 1; min-width: 0; }
.nw-list { display: grid; gap: 10px; }
.nw-item { display: block; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); color: inherit; text-decoration: none; }
.nw-item:hover { border-color: var(--gold-2, #c9a95e); }
.nw-it-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.nw-ex { font-size: 14px; color: var(--ink-2, inherit); margin-bottom: 6px; overflow-wrap: anywhere; }
.nw-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.nw-tpl { display: grid; gap: 4px; text-align: left; padding: 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper, transparent); color: inherit; cursor: pointer; font: inherit; }
.nw-tpl:hover, .nw-tpl:focus-visible { border-color: var(--gold-2, #c9a95e); box-shadow: 0 0 0 3px rgba(201, 169, 94, .18); }
.nw-tpl span:last-child { font-size: 13px; opacity: .75; }
.nw-ti { font-size: 26px; line-height: 1; }

/* ───────── редактор ───────── */
.nw-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: -6px 0 14px; }
.nw-title { flex: 1; min-width: 220px; font-size: 16px; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 6px; background: transparent; color: inherit; }
.nw-save.ok { color: var(--green, #2e7d4f); }
.nw-save.err { color: var(--red); font-weight: 600; }
.nw-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.nw-right { position: sticky; top: 12px; }
.nw-tabs { display: none; }
.nw-sec { margin-bottom: 14px; }
.nw-tb { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; margin-bottom: 10px; border: 1px solid var(--rule); border-radius: 8px; position: sticky; top: 0; z-index: 2; background: var(--paper); }
.nw-tb button { min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; font: inherit; font-size: 13px; }
.nw-tb button:hover, .nw-tb button:focus-visible { background: var(--rule-2, #eee); border-color: var(--rule); }
.nw-tb .sep { width: 1px; background: var(--rule); margin: 4px 2px; }
.nw-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.nw-fields .fld { display: grid; gap: 4px; margin: 0; }
.nw-fields .fld.full { grid-column: 1 / -1; }
.nw-fields .l { font-size: 13px; font-weight: 600; display: flex; gap: 4px; align-items: baseline; flex-wrap: wrap; }
.nw-fields .l .nw-fc { margin-left: auto; }
.nw-fields input, .nw-fields textarea, .nw-ta { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 6px; background: transparent; color: inherit; font: inherit; font-size: 15px; line-height: 1.45; }
.nw-ta { font-size: 15px; min-height: 320px; resize: vertical; }
.nw-fields textarea { resize: vertical; }
.nw-tfoot { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.nw-cnt { display: inline-block; font: 12px/1.6 "IBM Plex Mono", monospace; padding: 0 6px; border-radius: 4px; background: var(--rule-2, #eee); margin-left: 4px; }
.nw-cnt.near { background: #fff1d6; color: #8a5a00; }
.nw-cnt.over { background: #fde2e1; color: #9b2a26; font-weight: 600; }
.nw-fc { font-weight: 400; }
.nw-drop { border: 2px dashed var(--rule); border-radius: 10px; padding: 16px; text-align: center; display: grid; gap: 6px; justify-items: center; }
.nw-drop.over { border-color: var(--gold-2, #c9a95e); background: rgba(201, 169, 94, .08); }
.nw-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.nw-th { position: relative; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: #0002; cursor: grab; }
.nw-th img { display: block; width: 100%; height: 90px; object-fit: cover; }
.nw-miss { height: 90px; display: grid; place-items: center; font-size: 12px; text-align: center; padding: 6px; }
.nw-num { position: absolute; top: 4px; left: 4px; background: #000a; color: #fff; font-size: 12px; border-radius: 10px; padding: 0 7px; }
.nw-thb { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; }
.nw-thb button { width: 24px; height: 24px; border: 0; border-radius: 5px; background: #000b; color: #fff; cursor: pointer; font-size: 11px; }
.nw-thi { padding: 3px 6px; opacity: .75; }
.nw-pos { margin-top: 10px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.nw-roles { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; }
.nw-role { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.nw-role .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.nw-every { display: block; font-size: 13px; padding: 8px 10px; border: 1px solid #e8b4b1; border-radius: 6px; background: rgba(155, 42, 38, .05); }
.nw-sum { font-size: 14px; margin-bottom: 8px; }
.nw-err, .nw-warn, .nw-ok { font-size: 14px; padding: 7px 10px; border-radius: 6px; margin: 6px 0; }
.nw-err { background: #fde2e1; color: #7d1f1b; }
.nw-warn { background: #fff4dc; color: #6b4a00; }
.nw-ok { background: #e3f4e8; color: #1d5c34; }
.nw-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.nw-conf dd { overflow-wrap: anywhere; }
.nw-emo { display: grid; gap: 10px; max-height: 60vh; overflow: auto; }
.nw-el { display: grid; grid-template-columns: repeat(auto-fill, 40px); gap: 2px; }
.nw-el button { width: 40px; height: 40px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; display: grid; place-items: center; }
.nw-el button:hover, .nw-el button:focus-visible { background: var(--rule-2, #eee); }
.nw-el .dc-emoji { width: 26px; height: 26px; }
.err { color: var(--red); }
.nw-pvbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: inherit; padding: 6px 10px; cursor: pointer; font: inherit; font-size: 13px; }
.seg button.on { background: var(--navy, #0e2747); color: #fff; }
.nw-bnd { display: inline-flex; gap: 6px; align-items: center; }
[data-theme="dark"] .nw-err { background: #4a1c1a; color: #ffd2cf; }
[data-theme="dark"] .nw-warn { background: #43350f; color: #ffe7a8; }
[data-theme="dark"] .nw-ok { background: #173a24; color: #c4f0d2; }
[data-theme="dark"] .nw-cnt.near { background: #43350f; color: #ffe7a8; }
[data-theme="dark"] .nw-cnt.over { background: #4a1c1a; color: #ffd2cf; }
[data-theme="dark"] .nw-tb { background: var(--paper); }

/* ───────── перегляд «як у Discord» ───────── */
.dc-frame { --bg: #313338; --tx: #dbdee1; --hd: #f2f3f5; --mu: #949ba4; --ln: #00a8fc; --cd: #2b2d31; --cdb: #1e1f22; --qb: #4e5058; --mbg: rgba(88, 101, 242, .3); --mtx: #c9cdfb; --hov: #2e3035; --brd: #1f2023;
  background: var(--bg); color: var(--tx); border-radius: 8px; overflow: hidden; border: 1px solid var(--brd);
  font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.375; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
.dc-frame.light { --bg: #ffffff; --tx: #313338; --hd: #060607; --mu: #5c5e66; --ln: #006ce7; --cd: #ebedef; --cdb: #e3e5e8; --qb: #c4c9ce; --mbg: rgba(88, 101, 242, .15); --mtx: #4752c4; --hov: #f2f3f5; --brd: #e3e5e8; }
.dc-frame.phone { max-width: 390px; margin: 0 auto; border-radius: 18px; }
.dc-chan { white-space: nowrap; overflow: hidden; display: flex; align-items: center; gap: 6px; padding: 10px 16px; font-weight: 600; color: var(--hd); border-bottom: 1px solid var(--brd); box-shadow: 0 1px 0 rgba(0, 0, 0, .06); }
.dc-hash { color: var(--mu); font-size: 22px; font-weight: 400; line-height: 1; }
.dc-srv { overflow: hidden; text-overflow: ellipsis; margin-left: auto; font-weight: 400; font-size: 12px; color: var(--mu); }
.dc-feed { padding: 8px 0 18px; max-height: calc(100vh - 150px); overflow: auto; }
.dc-empty { padding: 30px 20px; color: var(--mu); text-align: center; font-size: 14px; }
.dc-msg { position: relative; padding: 2px 16px 2px 72px; min-height: 22px; overflow-wrap: anywhere; }
.dc-msg.first { margin-top: 10px; min-height: 44px; }
.dc-msg:hover { background: var(--hov); }
.dc-msg.mention { background: rgba(250, 168, 26, .1); }
.dc-msg.mention::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: #f0b232; }
.dc-av { position: absolute; left: 16px; top: 2px; width: 40px; height: 40px; border-radius: 50%; }
.dc-hd { display: flex; align-items: center; gap: 4px; line-height: 1.375; }
.dc-name { color: var(--hd); font-weight: 500; }
.dc-app { background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; line-height: 15px; height: 15px; padding: 0 4.5px; border-radius: 3px; margin-left: 2px; letter-spacing: .02em; }
.dc-time { color: var(--mu); font-size: 12px; margin-left: 4px; }
.dc-hov { position: absolute; left: 0; width: 64px; text-align: right; top: 4px; font-size: 11px; color: var(--mu); opacity: 0; }
.dc-msg:hover .dc-hov { opacity: 1; }
.dc-markup { white-space: normal; }
.dc-markup .dc-line { min-height: 1.375em; white-space: pre-wrap; }
.dc-h1, .dc-h2, .dc-h3 { color: var(--hd); font-weight: 700; line-height: 1.375; margin: 16px 0 8px; white-space: pre-wrap; }
.dc-h1 { font-size: 24px; } .dc-h2 { font-size: 20px; } .dc-h3 { font-size: 16px; }
.dc-markup > :first-child { margin-top: 0; }
.dc-sub { font-size: 13px; color: var(--mu); line-height: 1.11; white-space: pre-wrap; }
.dc-markup b { font-weight: 700; }
.dc-link { color: var(--ln); text-decoration: none; }
.dc-link:hover { text-decoration: underline; }
.dc-code { background: var(--cd); border-radius: 4px; padding: 0 .2em; font: 0.85em/1.125rem Consolas, "Andale Mono WT", monospace; }
.dc-pre { background: var(--cd); border: 1px solid var(--cdb); border-radius: 4px; padding: .5em; margin: 6px 0 0; font: 14px/1.125rem Consolas, monospace; white-space: pre-wrap; max-width: 90%; }
.dc-quote { border-left: 4px solid var(--qb); border-radius: 4px; padding: 0 8px 0 12px; }
.dc-quote + .dc-quote { margin-top: 0; }
.dc-list { margin: 4px 0 0 16px; padding: 0 0 0 16px; }
.dc-list li { margin-bottom: 4px; white-space: pre-wrap; }
.dc-list li.deep { margin-left: 24px; list-style-type: circle; }
.dc-list.q { border-left: 4px solid var(--qb); margin-left: 0; padding-left: 32px; }
.dc-spoil { background: var(--cdb); color: transparent; border-radius: 4px; }
.dc-spoil:hover { color: var(--tx); background: var(--cd); }
.dc-ment { background: var(--mbg); color: var(--mtx); border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-ment[style] { background: color-mix(in srgb, var(--rc) 18%, transparent); color: var(--rc); }
.dc-emoji { width: 1.375em; height: 1.375em; vertical-align: bottom; object-fit: contain; margin: 0 .05em 0 .1em; }
.dc-emoji.big { width: 48px; height: 48px; }
.dc-single { width: min(var(--w), 100%); aspect-ratio: var(--ar); margin-top: 4px; border-radius: 8px; overflow: hidden; background: var(--cd); }
.dc-single img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dc-mosaic { display: grid; gap: 4px; width: min(550px, 100%); margin-top: 4px; border-radius: 8px; overflow: hidden; }
.dc-row { display: grid; gap: 4px; }
.dc-row.c1 { grid-template-columns: 1fr; } .dc-row.c2 { grid-template-columns: 1fr 1fr; } .dc-row.c3 { grid-template-columns: 1fr 1fr 1fr; }
.dc-tile { aspect-ratio: 1; background: var(--cd); overflow: hidden; }
.dc-row.c1 .dc-tile { aspect-ratio: 2 / 1; }
.dc-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dc-bound { font: 11px/1.4 "IBM Plex Mono", monospace; color: var(--mu); border-top: 1px dashed var(--qb); margin: 6px 0 2px; padding-top: 2px; }
.dc-frame.phone .dc-msg { padding: 2px 12px 2px 64px; }
.dc-frame.phone .dc-av { left: 12px; }
.dc-frame.phone .dc-feed { max-height: 720px; }

@media (max-width: 1180px) {
  .nw-tabs { display: flex; gap: 6px; margin-bottom: 12px; position: sticky; top: 0; z-index: 3; background: var(--canvas); padding: 6px 0; }
  .nw-tabs button { flex: 1; padding: 9px; border: 1px solid var(--rule); border-radius: 8px; background: transparent; color: inherit; font: inherit; }
  .nw-tabs button.on { background: var(--navy, #0e2747); color: #fff; }
  .nw-grid { grid-template-columns: 1fr; }
  .nw-grid .nw-right { display: none; position: static; }
  .nw-grid[data-show="pv"] .nw-right { display: block; }
  .nw-grid[data-show="pv"] .nw-left { display: none; }
  .dc-frame.phone { border-radius: 8px; }
}
@media (max-width: 640px) { .dc-msg { padding-left: 64px; padding-right: 10px; } .dc-av { left: 12px; } }

@media (max-width: 640px) { .nw-fields { grid-template-columns: 1fr; } }
.nw-dest { font-size: 14px; line-height: 1.6; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 6px; margin-bottom: 8px; }
.nw-role { flex-wrap: wrap; }
