:root {
  --bg: #05060f;
  --card: #12141f;
  --line: #23263a;
  --purple: #663af3;
  --lavender: #b997ff;
  --yellow: #f6c600;
  --text: #f4f5fb;
  --muted: #9a9bb3;
  --danger: #ff4d6a;
  font-family: Inter, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 16px 16px 18px; }

.top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.logo { height: 48px; width: auto; display: block; background: none; }
h1 { font-family: Tektur, Inter, sans-serif; font-size: 26px; margin: 0; font-weight: 600; }
.sub { color: var(--lavender); font-size: 13px; margin-top: 1px; }
.admin-pill {
  margin-left: auto; background: var(--yellow); color: #1a1400;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700;
}

.ticket-head, .row, .sheet, .composer, .nick {
  background: #0c0e18; border: 1px solid var(--line); border-radius: 18px;
}
.ticket-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; }
.number { font-family: Tektur, Inter, sans-serif; font-size: 22px; }
.pill, .chip {
  border-radius: 999px; padding: 5px 10px; font-size: 12px; border: 1px solid var(--purple); color: var(--lavender);
  background: transparent;
}
.pill.on, .chip.on { background: #1a1038; color: #fff; }
.pill.wait, .chip.wait { border-color: var(--yellow); color: var(--yellow); }
.pill.closed, .chip.closed { border-color: #3a3d52; color: var(--muted); }
.chips { display: flex; gap: 8px; margin: 10px 0 12px; flex-wrap: wrap; }

.chat { display: flex; flex-direction: column; gap: 10px; min-height: 180px; margin-bottom: 12px; }
.bubble { max-width: 86%; padding: 10px 12px; border-radius: 16px; position: relative; }
.bubble .who { font-size: 11px; margin-bottom: 4px; color: var(--lavender); }
.bubble .when { position: absolute; right: 10px; top: 8px; font-size: 11px; color: #d9d4ff; }
.bubble.player { margin-left: auto; background: var(--purple); border-bottom-right-radius: 6px; }
.bubble.player .who { color: #efe9ff; }
.bubble.bot, .bubble.admin { margin-right: auto; background: #101221; border-bottom-left-radius: 6px; }
.bubble.bot { border: 1px solid #3a2d63; }
.bubble.admin { border: 1px solid var(--yellow); }
.bubble.admin .who { color: var(--yellow); }
.bubble p { margin: 0; white-space: pre-wrap; line-height: 1.35; }
.files { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.file {
  display: inline-flex; gap: 6px; align-items: center; background: #241a4a; border-radius: 10px;
  padding: 6px 8px; color: #fff; text-decoration: none; font-size: 12px; border: 0;
}

.quota { font-size: 13px; color: #d7d8e8; margin: 8px 2px 6px; }
.bar { height: 6px; border-radius: 99px; background: #241838; overflow: hidden; margin-bottom: 12px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, #7a4bff, var(--lavender)); }

.actions, .hints { display: flex; gap: 8px; }
.actions { margin-bottom: 10px; }
.actions button, .hints a, .tabs button, .sheet-actions button {
  border-radius: 14px; padding: 12px 10px; border: 0; text-decoration: none; text-align: center;
}
.grow { flex: 1; background: var(--purple); color: white; font-weight: 600; }
.ghost { flex: 1; background: transparent; color: var(--danger); border: 1px solid var(--danger) !important; }
.hints { margin-bottom: 12px; }
.hints a { flex: 1; border: 1px solid #3a2d63; color: var(--lavender); font-size: 12px; background: #100e1c; }

.composer { display: flex; gap: 8px; align-items: center; padding: 8px; }
.composer input[type="text"] {
  flex: 1 1 auto; min-width: 0; background: transparent; border: 0; outline: none; padding: 8px 4px;
}
.round {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
  cursor: pointer;
}
.round svg { width: 22px; height: 22px; display: block; flex: 0 0 auto; }
.round input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.attach { background: #171a28; color: var(--lavender); }
.send { background: var(--purple); color: #fff; }
.nick { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.nick input { background: #090b14; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }

.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs button { flex: 1; background: #12141f; color: var(--muted); border: 1px solid var(--line); position: relative; }
.tabs button.on { background: var(--purple); color: white; border-color: transparent; }
.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px;
  border-radius: 99px; background: var(--purple); color: white; font-size: 11px;
}
.tabs button.on .badge { background: white; color: var(--purple); }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; text-align: left; width: 100%; }
.row b { font-size: 16px; }
.row .meta { color: var(--lavender); font-size: 13px; }
.row .time { color: var(--muted); font-size: 12px; }

.sheet {
  position: sticky; bottom: 0; margin-top: 12px; padding: 14px; background: #0b0d16;
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.35);
}
.sheet-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 10px; }
.sheet-actions button { flex: 1; }
.dark { background: #1a1d2b; }
.back { background: transparent; border: 0; color: var(--lavender); padding: 0 0 8px; }
.empty, .gate { color: var(--muted); padding: 24px 8px; text-align: center; }
.toast { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 6px; }
