:root {
  --bg: #060606;
  --card: #101010;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f6f6f6;
  --muted: #9a9a9a;
  --glow: rgba(255, 255, 255, 0.08);
  --ok: #3ecf8e;
  --warn: #f0b429;
  --bad: #ff6b6b;
  --sans: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --display: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

button, input, select, textarea { font-family: inherit; }

button:not(:disabled),
a[href],
.btn,
.btn.start { cursor: pointer; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  background:
    radial-gradient(920px 520px at 12% -8%, rgba(255, 255, 255, 0.12), transparent 58%),
    radial-gradient(780px 460px at 92% 4%, rgba(255, 255, 255, 0.05), transparent 52%),
    radial-gradient(980px 560px at 50% 110%, rgba(255, 255, 255, 0.045), transparent 58%);
}

body::after {
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 12%, #000 8%, transparent 70%);
  opacity: 0.9;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }

button {
  border: 0;
  background: none;
}

img { display: block; max-width: 100%; height: auto; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 6, 6, 0.78);
  backdrop-filter: blur(18px) saturate(1.2);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.brand img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 0;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav a.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions .main-nav {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f3f3f3;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.top-actions .main-nav:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.04);
}

.profile {
  position: relative;
}

.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px 0 16px;
  border: 1px solid #2c2c2c;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.profile-btn svg {
  width: 16px;
  height: 16px;
}

.profile-btn[aria-expanded="true"] {
  background: #1a1a1a;
}

.profile-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 20;
  min-width: 180px;
  padding-top: 8px;
}

.profile-panel {
  min-width: 180px;
  padding: 6px;
  background: #141414;
  border: 1px solid #2c2c2c;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.profile-meta {
  padding: 10px 12px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-meta strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.profile-panel a,
.profile-panel button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: left;
  cursor: pointer;
}

.profile-panel a:hover,
.profile-panel button:hover,
.profile-panel a:focus-visible,
.profile-panel button:focus-visible {
  background: #222;
}

.page {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.home {
  width: 100%;
}

.hero {
  width: min(1080px, 100%);
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rise 0.7s ease both;
}

.hero-logo {
  width: 112px;
  height: 112px;
  border-radius: 24px;
  object-fit: cover;
  margin: 0 0 18px;
}

.hero-copy { animation: rise 0.8s ease 0.08s both; }

.kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 8vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 700;
  word-spacing: 0.04em;
}

.lede {
  max-width: 42ch;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: 100%;
  margin-top: 36px;
  animation: rise 0.85s ease 0.14s both;
}

.choice {
  position: relative;
  display: block;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.choice img {
  width: 100%;
  height: auto;
  display: block;
}

.choice-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 64px 20px 18px;
  text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
}

a.choice:hover {
  border-color: rgba(255, 255, 255, 0.42);
  transform: translateY(-3px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.4);
}

.choice.is-soon { cursor: default; }

.choice h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.choice span {
  color: #d8d8d8;
  font-size: 13px;
  font-weight: 600;
}

.search {
  display: flex;
  gap: 8px;
  max-width: 560px;
  align-items: center;
}

.search input {
  flex: 1;
  min-height: 40px;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 14px;
}

.hero .btn,
.search .btn,
.actions .btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 720px) {
  .choices { grid-template-columns: 1fr; gap: 12px; margin-top: 22px; }
  .hero-logo { width: 84px; height: 84px; border-radius: 18px; margin-bottom: 12px; }
  .hero h1 { font-size: clamp(28px, 9vw, 40px); word-spacing: normal; }
  .lede { font-size: 15px; margin-top: 10px; }
  .choice-copy { padding: 40px 14px 14px; }
  .choice-copy h2 { font-size: 22px; }
}


.search input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.composer textarea:focus {
  border-color: rgba(255, 255, 255, 0.4);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  min-height: 50px;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  border: 0;
  background: #fff;
  color: #111;
  overflow-wrap: anywhere;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.btn:hover { background: #ececec; }

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: #fff;
  color: #111;
}

.btn-primary:hover {
  background: #ececec;
}

.btn-ghost,
.ghost-btn {
  border: 1px solid var(--line);
  color: #fff;
  background: transparent;
}

.btn-ghost:hover,
.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.btn-danger {
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ffb4b4;
  background: transparent;
}

.btn-danger:hover {
  background: rgba(255, 92, 92, 0.08);
  border-color: rgba(255, 120, 120, 0.45);
}

.grid-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.cat {
  text-align: left;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 46%),
    var(--card);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.cat:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.cat strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cat span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 50%),
    var(--card);
  padding: 16px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.muted { color: var(--muted); }

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.ok,
.form-ok {
  margin: 12px 0 0;
  color: #d7d7d7;
  font-size: 14px;
}

.error,
.form-error {
  margin: 12px 0 0;
  color: #ffb4b4;
  font-size: 14px;
}

.form-error:empty,
.form-ok:empty { display: none; }

.search input,
.composer textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: #161616;
  border-radius: 12px;
  padding: 10px 14px;
  outline: none;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  background: #161616;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  outline: none;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tabs button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.tabs button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tabs button.is-active {
  background: #fff;
  color: #111;
  border-color: #fff;
}

.ticket-list {
  display: grid;
  gap: 10px;
}

.ticket-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 50%),
    var(--card);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.ticket-row:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.ticket-row .id {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
}

.badge.open { color: #fff; border-color: rgba(255,255,255,0.35); }
.badge.solved { color: var(--ok); border-color: rgba(62,207,142,0.35); }
.badge.closed { color: var(--muted); }
.badge.high, .badge.urgent { color: var(--warn); border-color: rgba(240,180,41,0.35); }
.badge.urgent { color: var(--bad); border-color: rgba(255,107,107,0.35); }

.form {
  display: grid;
  gap: 14px;
  max-width: 640px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
}

.field textarea { min-height: 110px; resize: vertical; }

.field .hint {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.btn.start {
  width: auto;
  margin: 18px 0 0;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.btn.start:hover { background: #ececec; }

.top-actions .btn {
  width: auto;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.thread {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.msg {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
}

.msg.staff { border-color: rgba(255, 255, 255, 0.22); background: rgba(255,255,255,0.04); }
.msg.system { color: var(--muted); font-size: 13px; background: transparent; }
.msg.internal { border-style: dashed; border-color: rgba(240,180,41,0.35); }

.msg-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.msg-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-body code, .msg-body pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.msg-body pre {
  margin: 8px 0 0;
  padding: 12px;
  border-radius: 12px;
  background: #000;
  overflow: auto;
}

.composer {
  display: grid;
  gap: 10px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 50%),
    var(--card);
}

.stat strong {
  display: block;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-family: var(--display);
}

.stat span { color: var(--muted); font-size: 13px; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.meta-grid div {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 50%),
    rgba(0, 0, 0, 0.2);
}

.meta-grid dt { color: var(--muted); font-size: 12px; }
.meta-grid dd { margin: 4px 0 0; font-weight: 600; }

.kb-list {
  display: grid;
  gap: 10px;
}

.kb-item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 50%),
    var(--card);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.kb-item:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.kb-item h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.kb-item p { margin: 0; color: var(--muted); font-size: 14px; }

.login-box {
  width: min(420px, 100%);
  margin: 28px auto auto;
  padding: 36px 32px 28px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(14, 14, 14, 0.94);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  display: grid;
  gap: 12px;
  animation: rise 0.4s ease both;
}

.login-box h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 44px);
  letter-spacing: -0.03em;
  font-weight: 700;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings {
  width: min(1040px, 100%);
  margin: 8px auto 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  container-type: inline-size;
  container-name: settings;
}

.settings-nav {
  display: grid;
  gap: 4px;
  position: sticky;
  top: 88px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.settings-nav .nav-label,
.nav-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-nav button,
.settings-nav a {
  width: 100%;
  text-align: left;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.settings-nav button:hover,
.settings-nav a:hover,
.settings-nav button[aria-current="page"],
.settings-nav button[aria-current="page"]:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.settings-nav .signout {
  margin-top: 8px;
  color: #ffb4b4;
}

.settings-nav .signout:hover {
  background: rgba(255, 92, 92, 0.08);
  color: #ffc9c9;
}

.settings-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.settings h1,
.settings-main h1 {
  font-size: clamp(36px, 5cqw, 52px);
  margin: 0;
  letter-spacing: -0.04em;
}

.settings h2,
.settings-main h2 {
  font-size: 20px;
  margin: 28px 0 12px;
}

.settings h3,
.settings-main h3 {
  margin: 22px 0 0;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.settings .hint a { text-decoration: underline; text-underline-offset: 3px; }

.settings-main > .hint {
  margin: 10px 0 0;
}

.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.info-cell {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.info-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.info-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 8px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
}

.info-value {
  margin: 0;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tip { flex: 0 0 auto; margin-left: auto; }

.tip-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #2a2a2a;
  color: #d7d7d7;
  cursor: pointer;
}

.tip-btn svg { width: 16px; height: 16px; }

.tip-btn:hover,
.tip-btn:focus-visible { background: #3a3a3a; color: #fff; }

.tip-bubble {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: calc(100% - 52px);
  padding: 12px 14px;
  border-radius: 10px;
  background: #2a2a2a;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  z-index: 8;
}

.info-cell:not(:has(.icon-btn)) .tip-bubble { width: 100%; }

.tip-bubble strong { font-weight: 700; }

.tip-bubble::after {
  content: "";
  position: absolute;
  bottom: 100%;
  right: 16px;
  border: 7px solid transparent;
  border-bottom-color: #2a2a2a;
}

.icon-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #111;
  cursor: pointer;
}

.icon-btn:hover { background: #e8e8e8; }

.method-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid #2c2c2c;
  border-radius: 12px;
  background: #181818;
  color: #fff;
}

.connected-list {
  display: grid;
  gap: 12px;
  margin: 14px 0 8px;
}

.connected-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.connected-card.is-on {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.connected-card.no-action {
  grid-template-columns: 44px 1fr;
}

.connected-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #161616;
  border: 1px solid var(--line);
}

.g-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: conic-gradient(#ea4335, #fbbc05, #34a853, #4285f4, #ea4335);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 auto;
}

.d-mark {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
}

.connected-copy {
  min-width: 0;
}

.connected-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.connected-title strong {
  font-size: 15px;
}

.connected-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.connected-pill.on {
  color: #d8d8d8;
  border-color: rgba(255, 255, 255, 0.22);
}

.connected-copy .hint {
  margin: 0;
}

.connected-action {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.connected-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 112px;
  min-height: 38px;
  padding: 0 16px;
  margin: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.connected-btn:active {
  transform: translateY(1px);
}

.connected-btn.connect {
  background: #f4f4f4;
  color: #0d0d0d;
  border: 1px solid transparent;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 8px 20px rgba(0, 0, 0, 0.28);
}

.connected-btn.connect:hover {
  background: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 10px 24px rgba(0, 0, 0, 0.34);
}

.connected-btn.disconnect {
  background: rgba(255, 255, 255, 0.03);
  color: #cfcfcf;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.connected-btn.disconnect:hover {
  background: rgba(255, 92, 92, 0.08);
  border-color: rgba(255, 120, 120, 0.35);
  color: #ffb4b4;
}

.delete-block {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.delete-block h2 { margin-bottom: 8px; }

.delete-block .btn { margin-top: 16px; }

.method {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #111;
}

.method-copy { flex: 1; min-width: 0; }

.method-copy .hint { margin: 4px 0 0; }

.method-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
}

.method-btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.method-btn.setup {
  border: 0;
  background: #fff;
  color: #111;
}

.method-btn.setup:hover { background: #e8e8e8; }

.method-btn.off {
  border: 1px solid #3a3a3a;
  background: transparent;
  color: #e8e8e8;
}

.method-btn.off:hover { background: #1c1c1c; }

.make-primary {
  border: 0;
  background: none;
  color: #fff;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.pill {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: 1px;
}

.guard {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #3d3420;
  border-radius: 14px;
  background: #17140e;
  color: #f3e6c4;
  font-size: 14px;
}

.btn.slim { margin-left: auto; width: auto; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.66);
}

.modal-card {
  width: min(440px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  background: #101010;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.modal-head h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cfcfcf;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: #1c1c1c;
  color: #fff;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.modal-actions .btn,
.modal-actions .btn-primary,
.modal-actions .btn-ghost,
.modal-actions .ghost-btn {
  width: auto;
  min-width: 104px;
  min-height: 40px;
  margin-top: 0;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-actions .btn,
.modal-actions .btn-primary {
  border: 0;
  background: #fff;
  color: #111;
}

.modal-actions .btn:hover,
.modal-actions .btn-primary:hover { background: #ececec; }

.modal-actions .btn-ghost,
.modal-actions .ghost-btn {
  background: #161616;
  border: 1px solid #3a3a3a;
  color: #eee;
}

.modal-actions .btn-ghost:hover,
.modal-actions .ghost-btn:hover { background: #222; }

.modal-actions .btn[hidden],
.modal-card [hidden] { display: none; }

.totp-secret {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0c0c0c;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .ticket-row {
    grid-template-columns: 1fr;
  }
  .nav { display: none; }
  .top { gap: 10px; }
  .settings {
    grid-template-columns: 1fr;
  }
  .settings-nav {
    position: static;
    grid-template-columns: 1fr 1fr;
  }
  .settings-nav .nav-label,
  .settings-nav .signout {
    grid-column: 1 / -1;
  }
  .info-row {
    grid-template-columns: 1fr;
  }
  .connected-card {
    grid-template-columns: 44px 1fr;
  }
  .method {
    flex-direction: column;
    align-items: stretch;
  }
  .connected-action,
  .method-actions {
    width: 100%;
    align-items: stretch;
  }
  .connected-btn,
  .method-btn {
    width: 100%;
    min-width: 0;
  }
  .choices { grid-template-columns: 1fr; }
  .tx-cats { grid-template-columns: 1fr; }
  .tx-chat-main { min-height: calc(100vh - 180px); }
  .tx-composer textarea { min-height: 72px; }
}

/* —— Ticket redesign system —— */
.tx-wrap {
  width: min(960px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.tx-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.tx-head h1,
.tx-head h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.03em;
}

.tx-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.tx-filters {
  display: grid;
  gap: 12px;
}

.tx-search {
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #121212;
  font-size: 14px;
  outline: none;
}

.tx-search:focus { border-color: rgba(255, 255, 255, 0.35); }

.tx-search-form { width: 100%; }

.tx-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.tx-cat-filter {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #121212;
  color: var(--text);
  font-size: 13px;
}

.tx-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tx-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  background: transparent;
}

.tx-tabs button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tx-tabs button.is-active {
  color: #111;
  background: #fff;
}

.tx-table {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(12, 12, 12, 0.9);
}

.tx-row {
  display: grid;
  grid-template-columns: 88px 1.1fr 140px 1.4fr 88px;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}

.tx-table.is-staff .tx-row {
  grid-template-columns: 88px 1.1fr 140px 1.4fr 88px 100px;
}

.tx-row-head {
  border-top: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.02);
}

a.tx-row:hover { background: rgba(255, 255, 255, 0.03); }

.tx-col-ticket strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tx-col-ticket span {
  color: var(--muted);
  font-size: 12px;
}

.tx-col-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.tx-status-open { color: #fff; border-color: rgba(255,255,255,0.28); }
.tx-status-waiting_staff { color: #f0b429; border-color: rgba(240,180,41,0.35); }
.tx-status-waiting_user { color: #7db7ff; border-color: rgba(125,183,255,0.35); }
.tx-status-solved { color: var(--ok); border-color: rgba(62,207,142,0.35); }
.tx-status-closed { color: var(--muted); }

.tx-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.tx-cat {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  text-align: left;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #101010;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tx-cat:hover { border-color: rgba(255, 255, 255, 0.22); }

.tx-cat.is-on {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.tx-cat-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #ddd;
}

.tx-cat-icon svg { width: 16px; height: 16px; fill: currentColor; }

.tx-cat-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tx-cat strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.tx-cat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.tx-form {
  margin-top: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101010;
  display: grid;
  gap: 12px;
  max-width: 720px;
}

.tx-summary {
  margin-top: 4px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.tx-summary h3 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.tx-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.tx-meta > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  font-size: 13px;
}

.tx-meta dt {
  margin: 0;
  color: var(--muted);
}

.tx-meta dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tx-chat-layout {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
  min-height: calc(100vh - 160px);
}

.tx-chat-main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: min(70vh, 760px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c0c0c;
  overflow: hidden;
}

.tx-chat-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.tx-back {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.tx-back:hover { color: var(--text); }

.tx-chat-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tx-chat-title strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.tx-chat-title span {
  color: var(--muted);
  font-size: 13px;
}

.tx-side-toggle {
  display: none;
  min-height: 34px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
}

.tx-thread {
  position: relative;
  overflow: auto;
  padding: 16px 14px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.tx-msg {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  max-width: 820px;
}

.tx-msg.system {
  grid-template-columns: 1fr;
  max-width: none;
  justify-items: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 4px 0;
}

.tx-msg.internal {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(240, 180, 41, 0.35);
  background: rgba(240, 180, 41, 0.05);
  max-width: 820px;
}

.tx-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: #1a1a1a;
  color: #ddd;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 36px;
}

.tx-msg-body {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #141414;
}

.tx-msg.staff .tx-msg-body {
  border-color: rgba(255, 255, 255, 0.14);
  background: #171717;
}

.tx-msg.user .tx-msg-body {
  background: #121212;
}

.tx-msg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.tx-msg-head strong {
  color: var(--text);
  font-size: 13px;
}

.tx-role {
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tx-msg-content {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tx-msg-content a { text-decoration: underline; text-underline-offset: 2px; }

.tx-msg-content pre,
.tx-msg-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.tx-msg-content pre {
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: #000;
  overflow: auto;
}

.tx-msg-atts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tx-att-thumb {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.tx-att-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text);
}

.tx-composer {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: grid;
  gap: 10px;
  background: #0f0f0f;
}

.tx-composer textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #161616;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.tx-composer textarea:focus { border-color: rgba(255, 255, 255, 0.35); }

.tx-composer.is-drag {
  outline: 1px dashed rgba(255, 255, 255, 0.35);
  outline-offset: -6px;
}

.tx-composer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tx-composer-actions .btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
}

.tx-attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tx-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #151515;
  font-size: 12px;
}

.tx-attach-chip img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
}

.tx-attach-chip button {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.tx-attach-chip button:hover { color: #ffb4b4; }

.tx-sidebar {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c0c0c;
  padding: 14px;
  display: grid;
  gap: 14px;
  position: sticky;
  top: 96px;
}

.tx-sidebar h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.tx-staff-tools,
.tx-customer-actions,
.tx-note-form,
.tx-license-form {
  display: grid;
  gap: 8px;
}

.tx-staff-tools select,
.tx-note-form textarea,
.tx-license-form input,
.tx-license-form textarea,
.tx-license-form select {
  width: 100%;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #161616;
  padding: 8px 10px;
  font-size: 13px;
}

.tx-note-form textarea { min-height: 72px; resize: vertical; }

.tx-staff-tools .btn,
.tx-customer-actions .btn,
.tx-note-form .btn,
.tx-license-form .btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
}

.tx-closed-note {
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.tx-empty {
  padding: 24px 14px;
  margin: 0;
}

.tx-staff-panel {
  width: min(1120px, 100%);
}

.tx-staff-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.tx-staff-stat {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #101010;
  display: grid;
  gap: 4px;
}

.tx-staff-stat strong {
  font-size: 22px;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.tx-staff-stat span {
  color: var(--muted);
  font-size: 12px;
}


.tx-new-msg {
  position: sticky;
  bottom: 12px;
  justify-self: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #1a1a1a;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.tx-new-msg[hidden] { display: none !important; }

.tx-staff-tools h4,
.tx-license-form h4 {
  margin: 4px 0 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 900px) {
  .tx-chat-layout {
    grid-template-columns: 1fr;
  }
  .tx-sidebar {
    position: static;
    display: none;
  }
  .tx-sidebar.is-open { display: grid; }
  .tx-side-toggle { display: inline-flex; }
  .tx-row {
    grid-template-columns: 72px 1fr auto;
  }
  .tx-row > :nth-child(3),
  .tx-row > :nth-child(4),
  .tx-row > :nth-child(6),
  .tx-row-head > :nth-child(3),
  .tx-row-head > :nth-child(4),
  .tx-row-head > :nth-child(6) {
    display: none;
  }
  .tx-meta > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
