/* Поддержка: список обращений, переписка, форма, рабочее место поддержки. Цвета заданы здесь: файл подключён и в кабинете сайта, и в админке */
html.tk-lock { overflow: hidden; }
.tk-list { display: grid; gap: 8px; margin-top: 14px; }
.tk-empty { color: #646c80; font-weight: 600; font-size: 14px; }
.tk-row { display: grid; gap: 5px; width: 100%; padding: 13px 15px; border-radius: 14px; background: #151a27; border: 1px solid #262d40; color: #e8ecf5; text-align: left; cursor: pointer; font: inherit; transition: border-color .15s, background .15s; }
.tk-row:hover { border-color: #3a4772; }
.tk-row.new { border-color: #3d7bff; background: rgba(61, 123, 255, .09); }
.tk-row-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.tk-row b { font-weight: 800; font-size: 15px; overflow-wrap: anywhere; }
.tk-row small { color: #7d8598; font-weight: 600; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.tk-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 800; white-space: nowrap; border: 1px solid transparent; }
.tk-chip.wait { color: #ffd38c; background: rgba(245, 177, 66, .1); border-color: rgba(245, 177, 66, .3); }
.tk-chip.ok { color: #8ff0b6; background: rgba(51, 209, 122, .1); border-color: rgba(51, 209, 122, .3); }
.tk-chip.off { color: #99a1b4; background: rgba(255, 255, 255, .05); border-color: #262d40; }
#support-card .dpanel-hd { flex-wrap: wrap; }

/* окно */
.tk-bg { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: rgba(5, 7, 12, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tk-box { display: flex; flex-direction: column; width: min(600px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); border-radius: 20px; background: linear-gradient(180deg, #151b2c, #10131d); border: 1px solid #262d40; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9); overflow: hidden; color: #e8ecf5; }
.tk-box.chat { width: min(680px, 100%); height: min(720px, calc(100vh - 32px)); height: min(720px, calc(100dvh - 32px)); }
.tk-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 12px; padding: 16px 16px 14px 20px; border-bottom: 1px solid #1e2435; }
.tk-head-t { flex: 1 1 220px; min-width: 0; }
.tk-head h2 { font-weight: 800; font-size: 17px; line-height: 1.3; overflow-wrap: break-word; color: #fff; }
.tk-head p { margin-top: 3px; color: #7d8598; font-weight: 600; font-size: 13px; overflow-wrap: break-word; }
.tk-head-a { flex: none; margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.tk-x { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #99a1b4; background: #151a27; border: 1px solid #262d40; cursor: pointer; }
.tk-x:hover { color: #fff; border-color: #3a4772; }
.tk-x .i { width: 15px; height: 15px; }
.tk-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.tk-link { padding: 0; background: none; border: 0; color: #7aa6ff; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.tk-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.tk-link.big { font-size: 16px; font-weight: 800; text-align: left; overflow-wrap: anywhere; }
.tk-link[hidden] { display: none; }

/* переписка */
.tk-msgs { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2c3652 transparent; }
.tk-msg { align-self: flex-start; max-width: 86%; padding: 10px 13px; border-radius: 14px 14px 14px 4px; background: #1a2030; border: 1px solid #262d40; }
.tk-msg.mine { align-self: flex-end; background: rgba(61, 123, 255, .16); border-color: rgba(61, 123, 255, .35); border-radius: 14px 14px 4px 14px; }
.tk-who { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: #7d8598; }
.tk-who b { color: #aeb6c9; font-weight: 800; }
.tk-text { white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 500; font-size: 14.5px; line-height: 1.5; color: #e8ecf5; }
.tk-text a { color: #8cb3ff; text-decoration: underline; text-underline-offset: 2px; }
.tk-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tk-imgs button { padding: 0; background: none; border: 0; cursor: zoom-in; }
.tk-imgs img { display: block; width: 130px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .08); }
.tk-sys { align-self: center; color: #646c80; font-weight: 600; font-size: 12.5px; text-align: center; }
.tk-view { position: fixed; inset: 0; z-index: 140; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .88); cursor: zoom-out; }
.tk-view img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* поле ответа */
.tk-compose { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 16px 14px; border-top: 1px solid #1e2435; }
.tk-compose[hidden], .tk-btn[hidden] { display: none; }
.tk-input { display: block; width: 100%; min-height: 46px; padding: 11px 13px; border-radius: 12px; background: #0d1120; border: 1px solid #262d40; color: #e8ecf5; font: inherit; font-weight: 500; font-size: 14.5px; line-height: 1.45; resize: none; outline: 0; box-sizing: border-box; }
.tk-input:focus { border-color: #3d7bff; box-shadow: 0 0 0 3px rgba(61, 123, 255, .14); }
.tk-input::placeholder { color: #646c80; }
.tk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tk-sends { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.tk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid transparent; color: #fff; background: linear-gradient(180deg, #4b87ff, #3170f5); font: inherit; font-weight: 700; font-size: 14px; white-space: nowrap; cursor: pointer; }
.tk-btn:hover { filter: brightness(1.08); }
.tk-btn:disabled { opacity: .55; cursor: default; }
.tk-btn.dark { color: #e8ecf5; background: #151a27; border-color: #262d40; }
.tk-btn.dark:hover { border-color: #3a4772; filter: none; }
.tk-btn .i { width: 16px; height: 16px; }
.tk-err { color: #ff8a8a; font-weight: 700; font-size: 13.5px; }
.tk-err[hidden], .tk-previews:empty { display: none; }
.tk-previews { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-prev { position: relative; }
.tk-prev img { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid #262d40; }
.tk-prev button { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #262d40; border: 1px solid #3a4772; color: #fff; cursor: pointer; }
.tk-prev .i { width: 11px; height: 11px; }

/* новое обращение */
.tk-form { display: grid; gap: 10px; padding: 14px 16px 2px; }
.tk-form + .tk-compose { border-top: 0; padding-top: 10px; }
.tk-form:only-child { padding-bottom: 16px; }
.tk-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-topic { height: 36px; padding: 0 13px; border-radius: 10px; background: #151a27; border: 1px solid #262d40; color: #e8ecf5; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.tk-topic:hover { border-color: #3a4772; }
.tk-topic[aria-pressed="true"] { border-color: #3d7bff; background: rgba(61, 123, 255, .14); }
.tk-select { width: 100%; height: 40px; padding: 0 10px; border-radius: 11px; background: #0d1120; border: 1px solid #262d40; color: #e8ecf5; font: inherit; font-weight: 600; font-size: 13.5px; }
.tk-select[hidden] { display: none; }
/* форма прямо на странице поддержки: карточка страницы уже даёт отступы */
.sup-new .tk-form { padding: 14px 0 0; }
.sup-new .tk-compose { padding: 10px 0 0; }
.sup-new .tk-input { min-height: 132px; }

/* страница обращения по ссылке из Telegram */
.desk { max-width: 1240px; margin: 0 auto; padding: 14px 16px 20px; }
.desk-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin-bottom: 14px; }
.desk .tk-pane { height: calc(100vh - 92px); height: calc(100dvh - 92px); }

/* рабочее место поддержки */
.tk-back { display: inline-block; margin-bottom: 12px; color: #7aa6ff; font-weight: 700; font-size: 14px; }
.tk-staff { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.tk-pane { display: flex; flex-direction: column; height: calc(100vh - 110px); height: calc(100dvh - 110px); min-height: 460px; border-radius: 18px; background: linear-gradient(180deg, #141927, #10131d); border: 1px solid #262d40; overflow: hidden; color: #e8ecf5; }
.tk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tk-tools .tk-select { flex: 1 1 220px; width: auto; min-width: 0; height: 36px; }
.tk-side { display: grid; gap: 12px; }
.tk-card { display: grid; gap: 8px; padding: 14px 16px; border-radius: 16px; background: #10131d; border: 1px solid #262d40; color: #e8ecf5; }
.tk-lbl { color: #7d8598; font-weight: 700; font-size: 12.5px; }
.tk-big { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.tk-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.tk-kv span { color: #7d8598; font-weight: 600; }
.tk-kv b { font-weight: 700; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.tk-order { display: grid; gap: 2px; width: 100%; padding: 8px 10px; border-radius: 10px; background: #151a27; border: 1px solid #262d40; color: #e8ecf5; font: inherit; text-align: left; }
button.tk-order { cursor: pointer; }
button.tk-order:hover { border-color: #3a4772; }
.tk-order b { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.tk-order small { color: #7d8598; font-size: 12px; font-weight: 600; }
@media (max-width: 1000px) {
  .tk-staff { grid-template-columns: minmax(0, 1fr); }
  .tk-pane { height: 74vh; min-height: 420px; }
}
@media (max-width: 560px) {
  .tk-bg { padding: 0; place-items: stretch; }
  .tk-box, .tk-box.chat { width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; }
  .tk-msgs { padding: 14px; }
  .tk-msg { max-width: 92%; }
  .tk-sends { flex: 1 1 100%; margin-left: 0; }
  .tk-sends .tk-btn { flex: 1 1 auto; }
  .tk-attach { flex: 1 1 100%; }
  /* меньше 16 px — iPhone приближает страницу при вводе */
  .tk-input, .tk-select { font-size: 16px; }
}
