/* light-theme: manual
   tickets.html "Meine Tickets" (assets/js/tickets.js). */

.tk-app { max-width: 860px; margin: 0 auto; }
.tk-card {
  border: 1px solid var(--nx-line, rgba(148, 163, 184, 0.16));
  border-radius: 20px;
  background: var(--nx-surface, rgba(15, 23, 42, 0.62));
  padding: 1.2rem;
}
.tk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin: 0 0 1rem; flex-wrap: wrap; }
.tk-head h2 { margin: 0; font-size: 1.4rem; font-weight: 800; }
.tk-meta { margin: 0.35rem 0 0; color: var(--nx-muted, #94a3b8); font-size: 0.88rem; }

.tk-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.05rem; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, #38bdf8, #6366f1); color: #fff;
  font: 700 0.9rem Inter, system-ui, sans-serif; text-decoration: none; cursor: pointer;
}
.tk-btn:hover { filter: brightness(1.1); }
.tk-btn:disabled { opacity: 0.6; cursor: default; }
.tk-btn.ghost { background: rgba(148, 163, 184, 0.12); color: var(--nx-text, #e2e8f0); }
.tk-btn.discord { background: #5865f2; }

.tk-login, .tk-empty, .tk-msg-box { text-align: center; padding: 2rem 1.4rem; }
.tk-login > i { font-size: 2.6rem; color: #8b9cff; }
.tk-login h2 { margin: 0.6rem 0 0.4rem; }
.tk-login p, .tk-empty p { color: var(--nx-muted, #94a3b8); max-width: 520px; margin: 0 auto 1rem; line-height: 1.6; }

.tk-list { padding: 0.4rem; }
.tk-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.9rem;
  padding: 0.85rem 0.9rem; border-radius: 14px; color: inherit; text-decoration: none;
}
.tk-row:hover { background: rgba(148, 163, 184, 0.08); }
.tk-row-main b { display: block; }
.tk-row-main small, .tk-row-time { color: var(--nx-muted, #94a3b8); font-size: 0.8rem; }
.tk-status { padding: 0.2rem 0.55rem; border-radius: 999px; font: 700 0.7rem "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: 0.05em; }
.tk-status.is-open { color: #34d399; background: rgba(16, 185, 129, 0.14); }
.tk-status.is-closed { color: #94a3b8; background: rgba(148, 163, 184, 0.14); }

.tk-form { display: grid; gap: 1rem; }
.tk-form label { display: grid; gap: 0.4rem; font-weight: 700; font-size: 0.9rem; }
.tk-form label[hidden] { display: none; }
.tk-form input, .tk-form select, .tk-form textarea, .tk-reply textarea, .tk-rate textarea {
  width: 100%; box-sizing: border-box; padding: 0.65rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.3); border-radius: 12px;
  background: rgba(2, 6, 23, 0.55); color: var(--nx-text, #e2e8f0);
  font: 500 0.95rem Inter, system-ui, sans-serif; resize: vertical;
}
.tk-form input:focus, .tk-form select:focus, .tk-form textarea:focus, .tk-reply textarea:focus, .tk-rate textarea:focus { outline: none; border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2); }
.tk-cats { border: 0; padding: 0; margin: 0; }
.tk-cats legend { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.4rem; }
.tk-cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.6rem; }
.tk-cat { position: relative; display: block !important; font-weight: 500 !important; cursor: pointer; }
.tk-cat input { position: absolute; opacity: 0; }
.tk-cat span { display: block; height: 100%; padding: 0.75rem 0.85rem; border: 1px solid rgba(148, 163, 184, 0.25); border-radius: 14px; }
.tk-cat small { display: block; margin-top: 0.25rem; color: var(--nx-muted, #94a3b8); font-size: 0.78rem; line-height: 1.4; }
.tk-cat input:checked + span { border-color: #38bdf8; background: rgba(56, 189, 248, 0.1); }
.tk-cat input:focus-visible + span { outline: 2px solid #38bdf8; outline-offset: 2px; }
.tk-error { min-height: 1.2em; margin: 0; color: #fca5a5; font-size: 0.85rem; }

.tk-thread { display: grid; gap: 0.9rem; max-height: 60vh; overflow-y: auto; padding: 0.2rem 0.2rem 0.8rem; }
.tk-m { display: flex; gap: 0.7rem; align-items: flex-start; }
.tk-m.is-mine { flex-direction: row-reverse; }
.tk-av img, .tk-av i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #1e293b; font-style: normal; font-weight: 800; }
.tk-bubble { max-width: min(78%, 560px); padding: 0.7rem 0.85rem; border-radius: 16px; background: rgba(148, 163, 184, 0.1); }
.tk-m.is-mine .tk-bubble { background: rgba(56, 189, 248, 0.14); }
.tk-m.is-staff .tk-bubble { background: rgba(88, 101, 242, 0.16); border: 1px solid rgba(88, 101, 242, 0.35); }
.tk-m-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.45rem; margin-bottom: 0.25rem; }
.tk-m-head small { color: var(--nx-muted, #94a3b8); font-size: 0.72rem; }
.tk-tag { padding: 0.05rem 0.4rem; border-radius: 6px; background: #5865f2; color: #fff; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; }
.tk-m-text { line-height: 1.55; overflow-wrap: anywhere; }
.tk-att { margin-top: 0.4rem; display: flex; flex-wrap: wrap; gap: 0.6rem; font-size: 0.82rem; }
.tk-att a { color: #7dd3fc; }
.tk-reply { display: grid; gap: 0.6rem; margin-top: 0.6rem; padding-top: 0.9rem; border-top: 1px solid rgba(148, 163, 184, 0.15); }
.tk-reply-row { display: flex; align-items: center; gap: 0.6rem; }
.tk-reply-row .tk-error { flex: 1; }
.tk-closed-note { margin: 0.6rem 0 0; padding-top: 0.9rem; border-top: 1px solid rgba(148, 163, 184, 0.15); color: var(--nx-muted, #94a3b8); font-size: 0.9rem; }

@media (max-width: 640px) {
  .tk-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .tk-bubble { max-width: 85%; }
  .tk-reply-row { flex-wrap: wrap; }
}

html[data-theme="light"] .tk-card { background: #fff; border-color: rgba(15, 23, 42, 0.1); }
html[data-theme="light"] .tk-form input, html[data-theme="light"] .tk-form select,
html[data-theme="light"] .tk-form textarea, html[data-theme="light"] .tk-reply textarea, html[data-theme="light"] .tk-rate textarea { background: #f8fafc; color: #0f172a; border-color: rgba(15, 23, 42, 0.15); }
html[data-theme="light"] .tk-btn.ghost { color: #0f172a; background: #f1f5f9; }
html[data-theme="light"] .tk-av img, html[data-theme="light"] .tk-av i { background: #e2e8f0; }
html[data-theme="light"] .tk-bubble { background: #f1f5f9; }
html[data-theme="light"] .tk-m.is-mine .tk-bubble { background: #e0f2fe; }
html[data-theme="light"] .tk-m.is-staff .tk-bubble { background: #eef2ff; }
html[data-theme="light"] .tk-att a { color: #0369a1; }

/* team area */
.tk-tabs, .tk-servers, .tk-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.tk-tabs a, .tk-servers a, .tk-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.9rem; border-radius: 999px; border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--nx-text, #e2e8f0); font-weight: 700; font-size: 0.86rem; text-decoration: none;
}
.tk-tabs a.is-on, .tk-servers a.is-on { background: linear-gradient(135deg, #38bdf8, #6366f1); border-color: transparent; color: #fff; }
.tk-chip.is-on { border-color: #38bdf8; background: rgba(56, 189, 248, 0.12); }
.tk-count { min-width: 1.4em; padding: 0 0.35em; border-radius: 999px; background: rgba(148, 163, 184, 0.2); font-size: 0.75rem; text-align: center; }
.is-on .tk-count { background: rgba(255, 255, 255, 0.25); }
.tk-none { margin: 0; padding: 1.2rem; color: var(--nx-muted, #94a3b8); text-align: center; }
.tk-assignee { color: #a5b4fc; }
.tk-free { color: #fbbf24; }
.tk-teambar { margin-bottom: 1rem; padding: 0.8rem 1rem; font-size: 0.9rem; }
.tk-teambar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.2rem; }
.tk-teambar-btns { display: inline-flex; gap: 0.5rem; margin-left: auto; }
.tk-who-list { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.tk-who { padding: 0.15rem 0.55rem; border-radius: 999px; background: rgba(129, 140, 248, 0.18); color: #c7d2fe; font-weight: 700; font-size: 0.8rem; }
.tk-who.is-role { background: rgba(88, 101, 242, 0.25); }
.tk-assign-edit { display: grid; gap: 0.8rem; margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid rgba(148, 163, 184, 0.15); }
.tk-assign-edit[hidden] { display: none; }
.tk-assign-edit fieldset { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0; padding: 0; border: 0; }
.tk-assign-edit legend { width: 100%; margin-bottom: 0.3rem; font-weight: 800; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--nx-muted, #94a3b8); }
.tk-assign-edit label { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.tk-assign-edit small { color: var(--nx-muted, #94a3b8); }
.tk-assign-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.tk-teambar label { display: inline-flex; align-items: center; gap: 0.5rem; }
.tk-teambar select { padding: 0.45rem 0.6rem; border: 1px solid rgba(148, 163, 184, 0.3); border-radius: 10px; background: rgba(2, 6, 23, 0.55); color: var(--nx-text, #e2e8f0); font: 600 0.88rem Inter, system-ui, sans-serif; }
.tk-teambar .tk-btn { padding: 0.45rem 0.85rem; }
.tk-teambar .tk-error { flex-basis: 100%; min-height: 0; }

html[data-theme="light"] .tk-tabs a, html[data-theme="light"] .tk-servers a, html[data-theme="light"] .tk-chip { color: #0f172a; border-color: rgba(15, 23, 42, 0.15); }
html[data-theme="light"] .tk-tabs a.is-on, html[data-theme="light"] .tk-servers a.is-on { color: #fff; }
html[data-theme="light"] .tk-teambar select { background: #f8fafc; color: #0f172a; }
html[data-theme="light"] .tk-assignee { color: #4338ca; }
html[data-theme="light"] .tk-free { color: #b45309; }
.tk-error a { color: #7dd3fc; font-weight: 700; }

html[data-theme="light"] .tk-who { color: #3730a3; background: #e0e7ff; }

/* ---------- polish: project stripe, team bar, pickers ---------- */
.tk-row { position: relative; padding-left: 1.15rem; }
.tk-row::before { content: ""; position: absolute; left: 0.35rem; top: 0.7rem; bottom: 0.7rem; width: 3px; border-radius: 3px; background: var(--srv, #38bdf8); opacity: 0.85; }
.tk-row[data-srv="nexcraft"] { --srv: #10b981; }
.tk-row[data-srv="nexpal"] { --srv: #f59e0b; }
.tk-row[data-srv="nexspace"] { --srv: #a78bfa; }
.tk-row + .tk-row { border-top: 1px solid rgba(148, 163, 184, 0.08); }

.tk-teambar { background: linear-gradient(135deg, rgba(88, 101, 242, 0.12), transparent 60%), var(--nx-surface, rgba(15, 23, 42, 0.62)); border-color: rgba(129, 140, 248, 0.28); }
.tk-tb-item { display: grid; gap: 0.25rem; }
.tk-tb-item > small { color: var(--nx-muted, #94a3b8); font: 700 0.68rem "JetBrains Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; }
.tk-tb-item > b { font-size: 0.95rem; }
.tk-teambar-btns { align-self: center; }

.tk-assign-edit fieldset { gap: 0.5rem; }
.tk-pick {
  position: relative;
  display: inline-flex !important; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
  border: 1px solid rgba(148, 163, 184, 0.25); border-radius: 999px;
  background: rgba(2, 6, 23, 0.35);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  user-select: none;
}
.tk-pick:hover { border-color: rgba(129, 140, 248, 0.6); }
.tk-pick:active { transform: scale(0.97); }
.tk-pick input { position: absolute; opacity: 0; pointer-events: none; }
.tk-pick img, .tk-pick-av { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: #1e293b; font-weight: 800; font-size: 0.75rem; font-style: normal; color: #c7d2fe; }
.tk-pick.is-role .tk-pick-av { background: rgba(88, 101, 242, 0.35); color: #fff; }
.tk-pick > span:last-child { display: grid; line-height: 1.15; }
.tk-pick b { font-size: 0.85rem; }
.tk-pick small { font-size: 0.68rem; }
.tk-pick:has(input:checked) { border-color: #818cf8; background: rgba(99, 102, 241, 0.22); box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.4) inset; }
.tk-pick:has(input:checked)::after { content: "\2713"; margin-left: 0.15rem; color: #a5b4fc; font-weight: 800; }
.tk-pick:has(input:focus-visible) { outline: 2px solid #38bdf8; outline-offset: 2px; }

html[data-theme="light"] .tk-teambar { background: linear-gradient(135deg, #eef2ff, #fff 60%); }
html[data-theme="light"] .tk-pick { background: #f8fafc; border-color: rgba(15, 23, 42, 0.15); }
html[data-theme="light"] .tk-pick:has(input:checked) { background: #e0e7ff; border-color: #6366f1; }
html[data-theme="light"] .tk-pick img, html[data-theme="light"] .tk-pick-av { background: #e2e8f0; color: #3730a3; }

/* ---------- grouped by server + archive ---------- */
.tk-group { margin-bottom: 1.1rem; }
.tk-group h3 { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.5rem 0.2rem; font-size: 0.95rem; font-weight: 800; }
.tk-group h3 i { width: 10px; height: 10px; border-radius: 3px; background: var(--srv, #38bdf8); box-shadow: 0 0 10px var(--srv, #38bdf8); }
.tk-group[data-srv="nexcraft"] { --srv: #10b981; }
.tk-group[data-srv="nexpal"] { --srv: #f59e0b; }
.tk-group[data-srv="nexspace"] { --srv: #a78bfa; }
.tk-row[hidden] { display: none; }
.tk-search { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.8rem; padding: 0 0.9rem; border: 1px solid rgba(148, 163, 184, 0.25); border-radius: 12px; background: rgba(2, 6, 23, 0.45); }
.tk-search i { color: var(--nx-muted, #94a3b8); }
.tk-search input { flex: 1; padding: 0.65rem 0; border: 0; background: none; color: var(--nx-text, #e2e8f0); font: 500 0.92rem Inter, system-ui, sans-serif; outline: none; }
.tk-search:focus-within { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2); }
html[data-theme="light"] .tk-search { background: #f8fafc; border-color: rgba(15, 23, 42, 0.15); }
html[data-theme="light"] .tk-search input { color: #0f172a; }
.tk-archive-bar { display: flex; gap: 0.6rem; align-items: stretch; margin: 0 0 0.8rem; }
.tk-archive-bar .tk-search { flex: 1; margin: 0; }
.tk-purge:hover { background: rgba(239, 68, 68, 0.22); color: #fca5a5; }
.tk-purged { margin: 0 0 0.8rem; padding: 0.6rem 0.9rem; border-radius: 12px; background: rgba(34, 197, 94, 0.12); color: #86efac; font-weight: 600; font-size: 0.88rem; }
@media (max-width: 640px) { .tk-archive-bar { flex-direction: column; } }


/* ratings: stars in rows, rated / rate box in closed tickets, public reference */
.tk-stars { color: #fbbf24; letter-spacing: 0.04em; margin-right: 0.5rem; white-space: nowrap; }
.tk-star-off { color: rgba(148, 163, 184, 0.35); }
.tk-rated, .tk-rate { margin: 0 1rem 1rem; padding: 0.9rem 1rem; border-radius: 14px; border: 1px solid rgba(251, 191, 36, 0.25); background: rgba(251, 191, 36, 0.06); }
.tk-rated { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; }
.tk-rated > span:first-child { font-weight: 700; font-size: 0.9rem; }
.tk-rated p { flex-basis: 100%; margin: 0; color: var(--nx-muted, #94a3b8); font-style: italic; }
.tk-rate { display: grid; gap: 0.6rem; }
.tk-rate-stars { display: flex; gap: 0.2rem; }
.tk-rate-stars button { border: 0; background: none; padding: 0 0.1rem; font-size: 2rem; line-height: 1; color: rgba(148, 163, 184, 0.35); cursor: pointer; transition: transform 0.12s ease, color 0.12s ease; }
.tk-rate-stars button.is-on { color: #fbbf24; }
.tk-rate-stars button:hover { transform: scale(1.12); }
.tk-rate-stars button:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; border-radius: 6px; }
.tk-rating-ref { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1.2rem; margin: 0 0 1.2rem; padding: 0.9rem 1.2rem; border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16); background: var(--nx-surface, rgba(15, 23, 42, 0.62)); }
.tk-rating-ref[hidden] { display: none; }
.tk-ref-main { display: flex; align-items: center; gap: 0.7rem; }
.tk-ref-main > b { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.tk-ref-main .tk-stars { font-size: 1.15rem; }
.tk-ref-main span:last-child { display: grid; font-weight: 700; font-size: 0.92rem; }
.tk-ref-main small { color: var(--nx-muted, #94a3b8); font-weight: 500; font-size: 0.8rem; }
.tk-ref-srv { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tk-ref-srv span { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.7rem; border-radius: 999px; border: 1px solid rgba(148, 163, 184, 0.18); font-size: 0.82rem; }
.tk-ref-srv i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tk-ref-srv b { color: #fbbf24; }
html[data-theme="light"] .tk-rating-ref { background: #fff; border-color: rgba(15, 23, 42, 0.1); }
html[data-theme="light"] .tk-ref-srv b, html[data-theme="light"] .tk-stars { color: #d97706; }
.tk-rating-ref { max-width: 860px; margin-left: auto; margin-right: auto; box-sizing: border-box; }

/* =====================================================================
   Redesign 2026-10: compact head + inbox (list | conversation | info)
   ===================================================================== */
:root .hb-page.tk-page { max-width: 1320px; padding-top: 6.2rem; padding-bottom: 5rem; }
.tk-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.2rem; margin: 0 0 1rem; }
.tk-top-title { flex: 1 1 360px; min-width: 0; }
.tk-top h1 { margin: 0; font: 800 clamp(1.5rem, 3vw, 2rem)/1.1 "Space Grotesk", Inter, sans-serif; }
.tk-top h1 span { background: linear-gradient(100deg, #38bdf8, #a855f7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tk-top p { margin: 0.3rem 0 0; color: var(--nx-muted, #94a3b8); font-size: 0.9rem; }
.tk-rate-strip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.6rem; padding: 0.4rem 0.85rem; border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18); background: rgba(2, 6, 23, 0.45); font-size: 0.84rem; }
.tk-rate-strip[hidden] { display: none; }
.tk-rate-strip > b { font-size: 1.05rem; }
.tk-rate-strip small { color: var(--nx-muted, #94a3b8); }
.tk-rate-strip .tk-stars { margin: 0; }
.tk-rate-strip .tk-ref-srv { display: inline-flex; gap: 0.3rem; }
.tk-rate-strip .tk-ref-srv span { padding: 0.1rem 0.5rem; font-size: 0.76rem; }
.tk-top-right { display: flex; align-items: center; gap: 0.5rem; }
.tk-switch { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(2, 6, 23, 0.45); border: 1px solid rgba(148, 163, 184, 0.18); }
.tk-switch a { padding: 0.42rem 0.9rem; border-radius: 9px; font-weight: 700; font-size: 0.86rem; color: var(--nx-muted, #94a3b8); text-decoration: none; white-space: nowrap; }
.tk-switch a.is-on { background: linear-gradient(135deg, #38bdf8, #6366f1); color: #fff; }
.tk-bell { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.8rem; border-radius: 12px; border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.45); color: var(--nx-muted, #94a3b8); font: 700 0.8rem Inter, system-ui, sans-serif; cursor: pointer; }
.tk-bell.is-on { color: #fcd34d; border-color: rgba(251, 191, 36, 0.4); }
.tk-btn.sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; border-radius: 10px; }

.tk-app { max-width: none; }
.tk-inbox { display: grid; grid-template-columns: 360px minmax(0, 1fr) 280px; gap: 14px; height: min(78vh, 820px); min-height: 520px; }
.tk-pane { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border: 1px solid var(--nx-line, rgba(148, 163, 184, 0.16)); border-radius: 18px;
  background: var(--nx-surface, rgba(15, 23, 42, 0.68)); }

/* list */
.tk-list-top { display: grid; gap: 0.6rem; padding: 0.8rem; border-bottom: 1px solid rgba(148, 163, 184, 0.14); }
.tk-list-title { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.tk-list-title h2 { margin: 0; font-size: 1.05rem; }
.tk-list-top .tk-chips, .tk-list-top .tk-srv { margin: 0; }
.tk-list-top .tk-chip { padding: 0.28rem 0.65rem; font-size: 0.78rem; }
.tk-list-top .tk-search { margin: 0; }
.tk-list-top .tk-search input { padding: 0.5rem 0; font-size: 0.86rem; }
.tk-srv { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 3px; border-radius: 11px; background: rgba(2, 6, 23, 0.45); }
.tk-srv a { display: inline-flex; justify-content: center; align-items: center; gap: 0.35rem; padding: 0.35rem 0.3rem; border-radius: 8px; font-size: 0.8rem; font-weight: 700;
  color: var(--nx-muted, #94a3b8); text-decoration: none; white-space: nowrap; }
.tk-srv a.is-on { background: color-mix(in srgb, var(--srv) 20%, transparent); color: var(--srv); }
.tk-items { flex: 1; overflow-y: auto; }
.tk-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 0.7rem; padding: 0.75rem 0.9rem 0.75rem 1.05rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08); color: inherit; text-decoration: none; }
.tk-item::before { content: ""; position: absolute; left: 0.35rem; top: 0.75rem; bottom: 0.75rem; width: 3px; border-radius: 3px; background: var(--srv); opacity: 0.8; }
.tk-item:hover { background: rgba(148, 163, 184, 0.06); }
.tk-item.is-sel { background: rgba(56, 189, 248, 0.09); box-shadow: inset 3px 0 0 #38bdf8; }
.tk-item[hidden] { display: none; }
.tk-item > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92rem; }
.tk-unread-dot { display: none; width: 8px; height: 8px; margin-right: 0.4rem; border-radius: 50%; background: #38bdf8; vertical-align: middle; }
.tk-item.is-unread .tk-unread-dot { display: inline-block; }
.tk-item.is-unread > b { color: #fff; }
.tk-when { font-size: 0.74rem; color: var(--nx-muted, #94a3b8); white-space: nowrap; }
.tk-when.is-late { color: #fca5a5; font-weight: 700; }
.tk-item-meta { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.5rem; min-width: 0; font-size: 0.76rem; color: var(--nx-muted, #94a3b8); }
.tk-item-meta > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-item-right { margin-left: auto; display: inline-flex; align-items: center; flex: none; }
.tk-av-mini { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: -5px; border-radius: 50%; border: 2px solid #0b1222;
  background: #6366f1; color: #fff; font: normal 800 0.6rem Inter, sans-serif; }
.tk-role-mini { font-size: 0.72rem; color: #a5b4fc; }
.tk-item-right .tk-stars { margin: 0; font-size: 0.74rem; }

/* status badges */
.tk-badge { display: inline-flex; align-items: center; gap: 0.3rem; flex: none; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 800; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.tk-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.tk-badge.b-new { --c: #22c55e; } .tk-badge.b-team { --c: #f59e0b; } .tk-badge.b-player { --c: #38bdf8; } .tk-badge.b-closed { --c: #94a3b8; }

/* conversation */
.tk-conv-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.85rem 1rem; border-bottom: 1px solid rgba(148, 163, 184, 0.14); }
.tk-conv-title { flex: 1; min-width: 0; }
.tk-conv-title h2 { margin: 0 0 0.25rem; font-size: 1.08rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-conv-title small { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; color: var(--nx-muted, #94a3b8); font-size: 0.78rem; }
.tk-conv-acts { display: flex; gap: 0.4rem; flex: none; }
.tk-back { display: none; }
.tk-conv .tk-thread { flex: 1; max-height: none; padding: 1rem; align-content: start; }
.tk-conv .tk-reply { margin: 0; padding: 0.8rem 1rem; }
.tk-conv .tk-reply textarea { min-height: 70px; }
.tk-conv .tk-closed-note { margin: 0; padding: 0.8rem 1rem; }
.tk-conv .tk-form { padding: 1rem; overflow-y: auto; }
.tk-loading { padding: 1.4rem; color: var(--nx-muted, #94a3b8); }
.tk-empty { margin: auto; padding: 2rem 1.4rem; text-align: center; color: var(--nx-muted, #94a3b8); }
.tk-empty > i { font-size: 2.2rem; color: #38bdf8; }
.tk-empty p { margin: 0.5rem 0; }
.tk-empty b { color: var(--nx-text, #e2e8f0); }
.tk-mdetails { display: none; }
.tk-msg-box { padding: 1.4rem; text-align: center; }
.tk-av img, .tk-av i { width: 34px; height: 34px; }

/* info sidebar */
.tk-info { padding: 1rem; gap: 1.1rem; overflow-y: auto; }
.tk-info-block h3 { margin: 0 0 0.45rem; font: 800 0.68rem "JetBrains Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--nx-muted, #94a3b8); }
.tk-person { display: flex; align-items: center; gap: 0.6rem; }
.tk-person b { display: block; }
.tk-person small { color: var(--nx-muted, #94a3b8); font-size: 0.78rem; }
.tk-av-big { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: #0ea5e9; color: #fff; font: normal 800 0.9rem Inter, sans-serif; }
.tk-kv { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.8rem; margin: 0; font-size: 0.84rem; }
.tk-kv dt { color: var(--nx-muted, #94a3b8); }
.tk-kv dd { margin: 0; }
.tk-srv-dot { display: inline-block; width: 8px; height: 8px; margin-right: 0.35rem; border-radius: 50%; background: var(--srv); }
.tk-who-list { margin-bottom: 0.5rem; }
.tk-who { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.55rem 0.15rem 0.2rem; }
.tk-who .tk-av-mini { margin: 0; border: 0; }
.tk-who.is-role { padding-left: 0.55rem; }
.tk-muted { margin: 0 0 0.5rem; color: var(--nx-muted, #94a3b8); font-size: 0.84rem; }
.tk-hint { padding: 0.6rem 0.75rem; border-radius: 12px; font-size: 0.8rem; line-height: 1.45; color: #fcd34d; background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.28); }
.tk-hint.is-blue { color: #7dd3fc; background: rgba(56, 189, 248, 0.08); border-color: rgba(56, 189, 248, 0.28); }
.tk-hint.is-calm { color: var(--nx-muted, #94a3b8); background: rgba(148, 163, 184, 0.08); border-color: rgba(148, 163, 184, 0.2); }
.tk-stack { display: grid; gap: 0.4rem; }
.tk-stack .tk-btn { justify-content: center; }
.tk-tips { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.4rem; color: var(--nx-muted, #94a3b8); font-size: 0.84rem; line-height: 1.45; }
.tk-tips a, .tk-help a { color: #7dd3fc; }
.tk-info-error:empty { display: none; }
.tk-info .tk-assign-edit fieldset { flex-direction: column; }

/* help suggestions while writing a ticket */
.tk-help { display: grid; gap: 0.45rem; padding: 0.8rem 0.9rem; border-radius: 14px; border: 1px solid rgba(56, 189, 248, 0.3); background: rgba(56, 189, 248, 0.07); font-size: 0.86rem; }
.tk-help[hidden] { display: none; }
.tk-help > b i { color: #fbbf24; }
.tk-help details { padding: 0.45rem 0.6rem; border-radius: 10px; background: rgba(2, 6, 23, 0.4); }
.tk-help summary { cursor: pointer; font-weight: 700; }
.tk-help details p { margin: 0.4rem 0; color: var(--nx-muted, #94a3b8); line-height: 1.5; }
.tk-help-link { display: block; padding: 0.45rem 0.6rem; border-radius: 10px; background: rgba(2, 6, 23, 0.4); font-weight: 700; text-decoration: none; }
.tk-help-kind { display: inline-block; margin-right: 0.3rem; padding: 0 0.4rem; border-radius: 6px; background: rgba(56, 189, 248, 0.2); color: #7dd3fc; font-size: 0.68rem; font-weight: 800; }
.tk-help small { color: var(--nx-muted, #94a3b8); }

/* tablets: no sidebar, details move into the conversation */
@media (max-width: 1100px) {
  .tk-inbox { grid-template-columns: 330px minmax(0, 1fr); }
  .tk-info { display: none; }
  .tk-mdetails { display: block; flex: none; margin: 0.6rem 1rem 0; padding: 0.55rem 0.75rem; border-radius: 12px; background: rgba(2, 6, 23, 0.4); border: 1px solid rgba(148, 163, 184, 0.14); }
  .tk-mdetails summary { cursor: pointer; font-weight: 700; font-size: 0.86rem; }
  .tk-mdetails[open] { max-height: 45vh; overflow-y: auto; flex: none; }
}
/* phones: list or ticket, never both */
@media (max-width: 720px) {
  :root .hb-page.tk-page { padding: 5.4rem 0.75rem 3rem; }
  .tk-top { margin-bottom: 0.8rem; }
  .tk-top p { display: none; }
  .tk-inbox { display: block; height: auto; min-height: 0; }
  .tk-inbox .tk-conv { display: none; }
  .tk-inbox.is-detail .tk-listpane { display: none; }
  .tk-inbox.is-detail .tk-conv { display: flex; height: calc(100vh - 7.5rem); }
  .tk-back { display: inline-flex; }
  .tk-conv-acts span { display: none; }
  .tk-conv-head { padding: 0.7rem; gap: 0.5rem; }
  .tk-bell span { display: none; }
  .tk-top-right { width: 100%; justify-content: space-between; }
}

html[data-theme="light"] .tk-pane { background: #fff; border-color: rgba(15, 23, 42, 0.1); }
html[data-theme="light"] .tk-rate-strip, html[data-theme="light"] .tk-switch, html[data-theme="light"] .tk-bell, html[data-theme="light"] .tk-srv { background: #f8fafc; border-color: rgba(15, 23, 42, 0.12); }
html[data-theme="light"] .tk-item.is-unread > b { color: #0f172a; }
html[data-theme="light"] .tk-av-mini { border-color: #fff; }
html[data-theme="light"] .tk-help details, html[data-theme="light"] .tk-help-link, html[data-theme="light"] .tk-mdetails { background: #f8fafc; }
html[data-theme="light"] .tk-hint { color: #92400e; }
html[data-theme="light"] .tk-hint.is-blue { color: #075985; }
.tk-list-top .tk-chips { gap: 0.3rem; flex-wrap: nowrap; }
.tk-list-top .tk-chip { padding: 0.25rem 0.5rem; gap: 0.3rem; font-size: 0.76rem; }
.tk-list-top .tk-count { font-size: 0.68rem; }

.tk-mdetails .tk-info-block, .tk-mdetails .tk-hint { margin-top: 0.8rem; }
@media (max-width: 720px) { body.tk-is-detail .tk-top { display: none; } body.tk-is-detail .tk-inbox.is-detail .tk-conv { height: calc(100vh - 6.5rem); } }
