/* Экран заявки: шапка со статусом, переписка, поле ввода, оценка. */

.screen.tk { display: flex; flex-direction: column; padding: 0; }

.tk-head { background: var(--card); padding: 12px 16px 14px; border-bottom: .5px solid var(--sep); }
.tk-top { display: flex; align-items: center; justify-content: space-between; margin: -4px -8px 0 0; }
.tk-title { font-size: 18px; font-weight: 700; line-height: 1.3; margin: 2px 0 8px; }
.tk-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.steps { display: flex; gap: 4px; margin-top: 14px; }
.steps div { flex: 1; }
.steps i { display: block; height: 4px; border-radius: 2px; background: var(--sep); transition: background .3s; }
.steps i.done { background: var(--c); }
.steps span { display: block; font-size: 11px; color: var(--hint); margin-top: 5px; }
.steps span.cur { color: var(--text); font-weight: 600; }
.tk-op { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; }
.tk-op small { display: block; color: var(--hint); font-size: 12px; }

.banner {
  display: flex; gap: 10px; margin: 10px 12px 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.4;
  background: color-mix(in srgb, var(--c) 13%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.banner span:first-child { font-size: 18px; }

.chat { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 12px 10px 14px; }
.day { align-self: center; margin: 8px 0 6px; font-size: 12px; font-weight: 600; color: var(--hint); }
.sys {
  align-self: center; max-width: 88%; margin: 4px 0; padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; color: var(--hint); text-align: center; background: color-mix(in srgb, var(--text) 6%, transparent);
}
.msg {
  max-width: 82%; padding: 7px 11px 6px; border-radius: 17px; line-height: 1.38;
  word-wrap: break-word; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.06);
}
.msg.new { animation: msgIn .2s ease; }
@keyframes msgIn { from { transform: translateY(6px); opacity: 0; } }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 5px; }
.msg.op { align-self: flex-start; background: var(--card); border-bottom-left-radius: 5px; }
.msg.me + .msg.me { border-top-right-radius: 8px; }
.msg.op + .msg.op { border-top-left-radius: 8px; }
.msg.me a { color: inherit; }
.msg-author { font-size: 13px; font-weight: 600; color: var(--link); margin-bottom: 1px; }
.msg-time { float: right; white-space: nowrap; font-size: 11px; opacity: .6; margin: 6px 0 -3px 10px; }
.msg-files { display: flex; flex-direction: column; gap: 6px; margin: 2px -5px 4px; }

.att-img {
  width: 230px; max-width: 100%; height: 160px; border-radius: 13px; background: var(--page) center/cover;
  display: grid; place-items: center; font-size: 46px; cursor: zoom-in;
}
.att-img.demo { background: linear-gradient(135deg, #8ec5fc, #e0c3fc); }
.att-file { display: flex; align-items: center; gap: 10px; padding: 2px 4px; }
.att-file-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; flex-shrink: 0; background: color-mix(in srgb, currentColor 16%, transparent); }
.att-file b { display: block; font-weight: 600; font-size: 14px; }
.att-file small { opacity: .7; font-size: 12px; }

.typing { align-self: flex-start; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 17px; border-bottom-left-radius: 5px; background: var(--card); font-size: 13px; color: var(--hint); }
.dots { display: flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--hint); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* поле ввода */
.tk-foot { position: sticky; bottom: 0; background: var(--bg); border-top: .5px solid var(--sep); }
.composer { display: flex; align-items: flex-end; gap: 4px; padding: 6px 6px 8px; }
.composer textarea {
  flex: 1; max-height: 130px; min-height: 38px; resize: none; outline: none; border: 0;
  padding: 9px 12px; border-radius: 19px; background: var(--page); color: var(--text); font: inherit; font-size: 16px; line-height: 1.3;
}
.send { background: var(--accent) !important; color: var(--accent-text); font-size: 18px; transition: transform .15s, opacity .15s; }
.send:disabled { opacity: 0; transform: scale(.5); pointer-events: none; width: 0; margin-left: -4px; }
.pending-files { display: flex; gap: 8px; padding: 8px 12px 0; overflow-x: auto; }
.pending-files:empty { display: none; }
.pending-files .thumb { width: 56px; height: 56px; flex-shrink: 0; }

/* закрытая заявка */
.closed { padding: 14px 16px 18px; text-align: center; }
.closed-title { font-weight: 600; margin-bottom: 2px; }
.closed p { color: var(--hint); font-size: 14px; }
.stars { display: flex; justify-content: center; gap: 6px; margin: 10px 0 14px; }
.stars button { border: 0; background: none; font-size: 32px; cursor: pointer; filter: grayscale(1); opacity: .35; transition: transform .15s, opacity .15s, filter .15s; padding: 0 2px; }
.stars button.on { filter: none; opacity: 1; }
.stars button:active { transform: scale(1.25); }
.closed .btn + .btn { margin-top: 8px; }
.reopen-box { padding: 10px 12px 12px; }
.reopen-box textarea { width: 100%; min-height: 70px; resize: none; outline: none; border: 0; border-radius: 12px; padding: 10px 12px; background: var(--page); color: var(--text); font: inherit; font-size: 16px; margin-bottom: 8px; }
.reopen-actions { display: flex; gap: 8px; }

.lightbox { position: absolute; inset: 0; z-index: 70; background: rgba(0,0,0,.92); display: grid; place-items: center; animation: fadeIn .2s; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; }
