/* Портал ТСН: доповнення до стилів порталу ДВВ (app.css v=67 — без змін). Кольори ДВВ (синій і золото) збігаються з емблемою ТСН */

/* Емблема ТСН (кругла) замість герба */
.brand img.tsnlogo { width: 46px; height: 46px; border-radius: 50%; }
.login .left img.tsnlogo.big { width: 112px; height: 112px; border-radius: 50%; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }

/* Бланк ТОВ «ТСН» */
.sheet.tsn .thead { display: grid; grid-template-columns: 74px 1fr 74px; align-items: center; gap: 12px; }
.sheet.tsn .tlogo { width: 74px; height: 74px; border-radius: 50%; }
.sheet.tsn .torg { text-align: center; }
.sheet.tsn .torg .o1 { font: 400 12.5px/1.4 var(--doc); letter-spacing: .06em; text-transform: uppercase; }
.sheet.tsn .torg .o2 { font: 700 19px/1.3 var(--doc); letter-spacing: .04em; }
.sheet.tsn .torg .o3 { font: 400 13px/1.4 var(--doc); color: #333; }
.sheet.tsn .rule2 { margin-top: 12px; }
.sheet.tsn .kind { margin-top: 18px; letter-spacing: .12em; }
.sheet.mini.tsn .tlogo { width: 48px; height: 48px; }
.sheet.mini.tsn .thead { grid-template-columns: 48px 1fr 48px; }
.sheet.mini.tsn .torg .o2 { font-size: 13px; }
.sheet.mini.tsn .torg .o1, .sheet.mini.tsn .torg .o3 { font-size: 9px; }
/* Печатка ТСН: у центрі — маска з емблеми ТСН (глобус, лаври, NG) */
.tsnseal i { -webkit-mask-image: url(/img/seal-tsn.png); mask-image: url(/img/seal-tsn.png); left: 18.5%; top: 18.5%; width: 63%; height: 63%; }

/* Як у порталі ЕМД: рядки заявок, кнопки подачі, чекліст підвищення */
.check { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 10px 16px; border-bottom: 1px solid var(--rule-2); }
.check:last-child { border-bottom: 0; }
.check .ok { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--canvas-2); color: var(--ink-3); }
.check .ok.on { background: var(--green-bg); color: var(--green); }
.check .tt { font-size: 14px; }
.check .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.reqrow { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule-2); cursor: pointer; }
.reqrow:hover { background: var(--canvas); }
.reqrow:last-child { border-bottom: 0; }
.reqrow .tt { font-weight: 600; }
.reqrow .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.dl2 { display: grid; grid-template-columns: 200px 1fr; gap: 6px 14px; font-size: 14px; }
.dl2 dt { color: var(--ink-3); }
.dl2 dd { margin: 0; word-break: break-word; white-space: pre-line; }
.typebtns { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.typebtns button { text-align: left; padding: 12px 14px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: var(--r); cursor: pointer; font: inherit; }
.typebtns button:hover:not([disabled]) { border-color: var(--navy-3); }
.typebtns button[disabled] { opacity: .55; cursor: not-allowed; }
.typebtns b { display: block; font-size: 14px; }
.typebtns span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.guardok { color: var(--green); font-weight: 600; }
.sigbox { display: flex; align-items: center; justify-content: center; min-height: 110px; border: 1px dashed var(--rule); border-radius: var(--r); background: #fbf7ee; padding: 10px; }
.sigbox img { max-height: 90px; max-width: 100%; }
.lawtext p { margin: 0 0 8px; line-height: 1.55; }
.lawtext { max-height: 62vh; overflow: auto; padding-right: 6px; }
.daytab td.n { text-align: center; font-variant-numeric: tabular-nums; }
.daytab td.zero { color: var(--red); }

/* Тема: темна */
:root[data-theme="dark"] .typebtns button { background: var(--paper); }
:root[data-theme="dark"] .sigbox { background: #1f1b13; }

/* Телефон */
@media (max-width: 640px) {
  .dl2 { grid-template-columns: 1fr; gap: 2px; }
  .dl2 dd { margin-bottom: 8px; }
  .typebtns { grid-template-columns: 1fr; }
  .sheet.tsn .thead { grid-template-columns: 48px 1fr; }
  .sheet.tsn .thead::after { display: none; }
  .sheet.tsn .tlogo { width: 48px; height: 48px; }
}

/* ───────── Новини ТСН: редактор і перегляд «як у Discord» ───────── */
.newsgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.newsgrid > div:last-child { position: sticky; top: 12px; }
.nblock { border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; background: var(--canvas); }
.nbh { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cnt { float: right; font-weight: 400; color: var(--ink-3); font-size: 11px; }
.cnt.over { color: var(--red); font-weight: 600; }
.swatches { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; box-shadow: 0 0 0 1px var(--rule); }
.sw.on { border-color: var(--ink); }
.imgpick { width: 120px; height: 80px; border: 1px dashed var(--rule); border-radius: var(--r); display: grid; place-items: center; cursor: pointer; overflow: hidden; flex: none; background: var(--paper); color: var(--ink-3); font-size: 12px; }
.imgpick img { width: 100%; height: 100%; object-fit: cover; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.mgrid figure { margin: 0; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: var(--paper); }
.mgrid.pick figure { cursor: pointer; }
.mgrid.pick figure:hover { border-color: var(--navy-3); }
.mgrid img { width: 100%; height: 90px; object-fit: cover; display: block; }
.mgrid figcaption { font-size: 11px; padding: 5px 7px; word-break: break-word; }
.small.err { color: var(--red); }
/* Discord (темна тема Discord — однакова в світлій і темній темі порталу) */
.dwrap { background: #313338; border-radius: 8px; padding: 14px 12px 16px; color: #dbdee1; font: 15px/1.375 "gg sans", "Noto Sans", "Helvetica Neue", Arial, sans-serif; }
.dhint { font-size: 12px; color: #949ba4; margin: 0 4px 10px; }
.dmsg { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.dav { width: 40px; height: 40px; border-radius: 50%; }
.dmain { min-width: 0; }
.dname { display: flex; align-items: center; gap: 6px; }
.dname b { color: #f2f3f5; font-weight: 600; }
.dapp { background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 4px; border-radius: 3px; line-height: 15px; }
.dtime { color: #949ba4; font-size: 12px; }
.dcontent { margin-top: 2px; word-wrap: break-word; }
.dcontent a, .demb a { color: #00a8fc; text-decoration: none; }
.dh1 { font-size: 24px; font-weight: 700; line-height: 1.3; margin: 8px 0 4px; color: #f2f3f5; }
.dh2 { font-size: 20px; font-weight: 700; margin: 8px 0 4px; color: #f2f3f5; }
.dh3 { font-size: 16px; font-weight: 700; margin: 8px 0 4px; color: #f2f3f5; }
.dsub { font-size: 12px; color: #949ba4; }
.dquote { border-left: 4px solid #4e5058; padding-left: 10px; }
.dgap { height: 1.1em; }
.dwrap ul, .dwrap ol { margin: 2px 0 2px 22px; padding: 0; }
.dwrap code { background: #2b2d31; border-radius: 3px; padding: 0 3px; font-size: 13px; }
.dwrap pre { background: #2b2d31; border: 1px solid #1e1f22; border-radius: 4px; padding: 6px 8px; white-space: pre-wrap; }
.dment { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dspoil { background: #1e1f22; color: transparent; border-radius: 3px; }
.dspoil:hover { color: inherit; }
.demb { display: grid; grid-template-columns: 1fr; max-width: 516px; margin-top: 8px; background: #2b2d31; border-left: 4px solid var(--c); border-radius: 4px; }
.demb.hasthumb { grid-template-columns: 1fr auto; }
.dbody { padding: 8px 16px 16px 12px; min-width: 0; }
.dauth { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 600; color: #f2f3f5; }
.dauth img { width: 24px; height: 24px; border-radius: 50%; }
.dtitle { margin-top: 8px; font-weight: 600; font-size: 16px; color: #f2f3f5; word-wrap: break-word; }
.ddesc { margin-top: 8px; font-size: 14px; line-height: 1.3; word-wrap: break-word; }
.ddesc .dh1 { font-size: 20px; } .ddesc .dh2 { font-size: 17px; } .ddesc .dh3 { font-size: 15px; }
.dimg { display: block; margin-top: 16px; max-width: 100%; max-height: 400px; border-radius: 4px; }
.dthumb { width: 80px; height: 80px; object-fit: contain; margin: 16px 16px 0 0; border-radius: 4px; }
.dfoot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: #b5bac1; }
.dfoot img { width: 20px; height: 20px; border-radius: 50%; }
@media (max-width: 860px) { .newsgrid { grid-template-columns: 1fr; } .newsgrid > div:last-child { position: static; } }
@media (max-width: 640px) { .dwrap { margin: 0 -6px; padding: 10px 8px 12px; } .dmsg { grid-template-columns: 32px 1fr; gap: 10px; } .dav { width: 32px; height: 32px; } .dbody { padding: 6px 10px 12px 10px; } }
#ed .fld { margin-bottom: 12px; }
#ed .fld .l { display: block; }
#ed .chk { margin: 4px 0 10px; }

/* Скріншоти доказів (урок ЕМД 18.11): кнопка, Ctrl+V, перетягування; мініатюри — лише поки файл у пам’яті до відправки */
.shots { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
.shots .thumbs { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.shots .thumbs:empty { display: none; }
.shots .thumbs img { height: 64px; max-width: 120px; object-fit: cover; border: 1px solid var(--rule, #ccc); border-radius: 4px; display: block; }
.shots [data-shotmsg].err { color: var(--red); font-weight: 600; }
.shots [data-shotmsg] ul { margin: 4px 0 0; padding-left: 18px; font-weight: 400; }
.fld.drop { outline: 2px dashed var(--gold-2, #b8892d); outline-offset: 4px; }
.fld.busy [data-shot] { opacity: .6; pointer-events: none; }
.actlog { margin: 0; padding-left: 18px; }
.actlog li { margin: 2px 0; }

/* Закритий доступ (сервер): екран коду запрошення */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--canvas); }
.gate-box { max-width: 460px; width: 100%; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 28px 24px; text-align: center; }
.gate-box h1 { font-size: 22px; margin: 12px 0 8px; }
.gate-box p { font-size: 14px; line-height: 1.5; }
.gate-box form { display: flex; gap: 8px; margin-top: 14px; }
.gate-box input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--rule); border-radius: 6px; background: transparent; color: inherit; font: inherit; }
.gate-err { color: var(--red); font-weight: 600; }
