/* WaveTicket dashboard */
:root {
  --bg: #242424;
  --bg-deep: #1e1e1e;
  --sidebar: #2d2d2d;
  --surface: #2b2b2b;
  --surface-2: #323232;
  --surface-3: #3f414a;
  --tile: #3e3e3e;
  --border: #383838;
  --border-strong: #424242;

  --text: #f2f2f2;
  --text-2: #d0d0d0;
  --muted: #999999;

  --accent: #5f78f6; /* from the logo */
  --accent-hover: #7187f7;
  --accent-press: #4b61e8;
  --accent-tint: rgba(95, 120, 246, 0.18);
  --accent-line: rgba(95, 120, 246, 0.4);
  --mention-fg: #c9d1fd;
  --danger: #e5484d;
  --success: #3ba55c;
  --warning: #f0b132;

  --radius: 8px;
  --radius-sm: 6px;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: 600 14px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-press); }
.btn-secondary { background: var(--surface-3); color: var(--text); }
.btn-secondary:hover { background: #4a4c56; }
.btn-dark { background: #212121; border-color: var(--border-strong); color: var(--text); }
.btn-dark:hover { background: #2a2a2a; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Top header (landing + server picker) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border-strong);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 19px;
}
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }

.page-main {
  position: relative;
  isolation: isolate;
  padding: 44px 0 72px;
}

/* dotted band under the header */
.dots::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 260px;
  background:
    radial-gradient(ellipse 55% 110px at 50% 0, rgba(95, 120, 246, 0.16), transparent),
    radial-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1.5px) 0 0 / 24px 24px;
  -webkit-mask-image: linear-gradient(#000 35%, transparent);
  mask-image: linear-gradient(#000 35%, transparent);
  pointer-events: none;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 28px;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- Landing ---------- */
.hero { padding: 64px 0 80px; text-align: center; }
.hero h1 {
  margin: 0 auto 12px;
  max-width: 720px;
  font-size: 44px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.hero p { margin: 0 auto; max-width: 540px; color: var(--text-2); font-size: 18px; }
.hero-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero .alert { max-width: 540px; margin: 0 auto 28px; text-align: left; }

.section-rule { border: 0; border-top: 1px solid var(--border-strong); margin: 0; }

.features { padding: 64px 0 24px; text-align: center; }
.features h2 { margin: 0 0 6px; font-size: 30px; font-weight: 800; }
.features > p { margin: 0 0 36px; color: var(--text-2); }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; text-align: left; }
.feature { padding: 24px; }
.feature h3 { margin: 18px 0 6px; font-size: 16px; font-weight: 700; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }

.tile {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--tile);
  color: var(--text-2);
}
.tile-blue { background: rgba(95, 120, 246, 0.2); color: #8fa0fa; }
.tile-red { background: rgba(229, 72, 77, 0.18); color: #f27b7f; }
.tile-green { background: rgba(59, 165, 92, 0.2); color: #5fcf85; }
.tile-yellow { background: rgba(240, 177, 50, 0.18); color: #f5c65f; }

.alert {
  padding: 11px 14px;
  border: 1px solid rgba(229, 72, 77, 0.45);
  border-radius: var(--radius);
  background: rgba(229, 72, 77, 0.1);
  color: #f6b9bb;
  font-size: 14.5px;
}

/* ---------- Cards, avatars, menus ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
}
.avatar--fallback {
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  user-select: none;
}
.avatar--xs { width: 18px; height: 18px; font-size: 9px; }
.avatar--sm { width: 22px; height: 22px; font-size: 11px; }
.avatar--md { width: 30px; height: 30px; font-size: 13px; }

.guild-icon {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-3);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  user-select: none;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-2);
}
.user-chip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropdown { position: relative; }
.menu {
  position: absolute;
  z-index: 40;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.menu-item.current { color: var(--text); }
.menu-item .guild-icon { width: 24px; height: 24px; border-radius: 6px; font-size: 10px; }
.menu-item .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-sep { height: 1px; margin: 6px 0; background: var(--border-strong); }
.menu-item.danger { color: #f27b7f; }

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
}
.user-menu-btn:hover { background: var(--surface-2); }
.user-menu-btn .name {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.user-menu-btn svg { color: var(--muted); }
.header-right .menu { right: 0; top: calc(100% + 6px); }

/* ---------- Server picker ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-head h1 { margin: 0 0 4px; font-size: 30px; font-weight: 800; letter-spacing: -0.01em; }
.page-head p { margin: 0; color: var(--muted); }

.group-title {
  margin: 32px 0 12px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.group-title:first-child { margin-top: 0; }
.server-card .info { min-width: 0; }

.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.server-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  color: var(--text);
}
a.server-card:hover { text-decoration: none; border-color: #555; }
.server-card .top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.server-card .guild-icon { width: 52px; height: 52px; border-radius: 14px; font-size: 16px; }
.server-card .name {
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.server-card .meta { color: var(--muted); font-size: 13.5px; }
.server-card .btn { margin-top: auto; }

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Dashboard layout ---------- */
.dash { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }

.dash-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px 12px 12px;
  background: var(--sidebar);
  border-right: 1px solid var(--border-strong);
  overflow-y: auto;
}
.dash-sidebar > .brand { padding: 0 6px 14px; border-bottom: 1px solid var(--border-strong); }

.guild-switch { margin: 14px 0 10px; }
.guild-switch-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px 7px 7px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #333;
  cursor: pointer;
  text-align: left;
}
.guild-switch-btn:hover { background: #383838; }
.guild-switch-btn .guild-icon { width: 28px; height: 28px; border-radius: 7px; font-size: 11px; }
.guild-switch-btn .name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guild-switch-btn svg { flex: none; color: var(--muted); }
.guild-switch .menu { left: 0; right: 0; top: calc(100% + 6px); max-height: 320px; overflow-y: auto; }

.nav-section {
  margin: 18px 0 6px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 0;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 600;
}
.nav-item svg { flex: none; color: var(--muted); }
.nav-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-tint); color: var(--text); }
.nav-item.active svg { color: var(--accent-hover); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.sidebar-foot { margin-top: auto; padding-top: 16px; }
.sidebar-links {
  display: flex;
  gap: 14px;
  padding: 10px 8px;
  border-top: 1px solid var(--border-strong);
  font-size: 13px;
}
.sidebar-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.sidebar-links a:hover { color: var(--text); text-decoration: none; }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px 8px 10px;
  border-radius: var(--radius);
  background: var(--bg);
}
.user-card .who { flex: 1; min-width: 0; line-height: 1.25; }
.user-card .name {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-card .sub { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }

.dash-topbar { display: none; }
.dash-backdrop { display: none; }

.dash-content {
  width: 100%;
  max-width: 1760px;
  padding: 28px 32px 56px;
}

/* ---------- Dashboard pieces ---------- */
.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: rgba(95, 120, 246, 0.08);
  color: var(--text);
  font-size: 14.5px;
}
.notice > svg { flex: none; color: var(--accent-hover); }
.notice p { flex: 1; margin: 0; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 12.5px var(--mono);
  cursor: pointer;
}
.copy-btn:hover { color: var(--text-2); }

.panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.loading { display: grid; gap: 16px; }
.loading .skeleton:nth-child(1) { height: 96px; }
.loading .skeleton:nth-child(2) { height: 240px; }

.error-box { padding: 40px 24px; text-align: center; }
.error-box h1 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.error-box p { margin: 0 0 18px; color: var(--muted); }

/* ---------- Transcript list ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.search { position: relative; width: 280px; max-width: 100%; }
.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.input, .select {
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  color: var(--text);
  font: 14px var(--font);
}
.input { width: 100%; padding: 0 12px 0 34px; }
.input::placeholder { color: var(--muted); }
.select { padding: 0 10px; cursor: pointer; max-width: 200px; }
.input:focus, .select:focus { outline: none; border-color: var(--accent); }

.list-card { overflow: hidden; }
.list-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 90px 170px;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 14.5px;
}
.list-row:first-child { border-top: 0; }
.list-row--head { padding-top: 10px; padding-bottom: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
a.list-row:hover { background: var(--surface-2); text-decoration: none; }

.ticket-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ticket-cell > svg { flex: none; color: var(--muted); }
.ticket-cell > div { min-width: 0; }
.ticket-cell .title { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-cell .sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stars { color: var(--warning); letter-spacing: 1px; }
.cell-label { display: none; }
.list-count { margin: 0 0 10px; font-size: 14px; }
.list-row.is-unavailable { opacity: 0.55; }

/* ---------- Transcript view ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
}
.back-link:hover { color: var(--text); text-decoration: none; }

.transcript-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.sidebar-card { position: sticky; top: 20px; padding: 4px 20px 20px; }
.sidebar-card dl { margin: 0; }
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.info-row dt { font-weight: 600; color: var(--text); flex: none; }
.info-row dd { margin: 0; min-width: 0; color: var(--text-2); text-align: right; overflow-wrap: anywhere; }
.server-name { display: inline-flex; align-items: center; gap: 7px; }
.server-name .guild-icon { width: 20px; height: 20px; border-radius: 5px; font-size: 9px; }
.members { display: flex; justify-content: flex-end; flex-wrap: wrap; }
.members .avatar { width: 26px; height: 26px; border: 2px solid var(--surface); margin-left: -6px; font-size: 11px; }
.members .avatar:first-child { margin-left: 0; }
.closer .name { color: var(--text); font-weight: 600; }
.closer .copy-btn { display: block; margin: 1px 0 0 auto; font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 12px; }
.value-empty { color: var(--muted); }
.sidebar-card .btn { margin-top: 18px; }

.chat { padding: 22px 22px 18px; min-height: 200px; }
.chat-head { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.chat-head h1 { margin: 0 0 2px; font-size: 22px; font-weight: 800; overflow-wrap: anywhere; }
.chat-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.chat-note {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
}

.messages { padding-top: 4px; }
.msg {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 16px;
  margin: 0 -22px;
  padding: 2px 22px;
}
.msg:hover { background: rgba(0, 0, 0, 0.1); }
.msg--first { margin-top: 14px; padding-top: 4px; }
.msg-gutter { padding-top: 2px; }
.msg-hover-time {
  display: block;
  padding-top: 3px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
  visibility: hidden;
}
.msg:hover .msg-hover-time { visibility: visible; }
.msg-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 7px; }
.msg-author { font-weight: 600; color: var(--text); }
.msg-time { color: var(--muted); font-size: 12px; }
.msg-body { color: var(--text-2); overflow-wrap: anywhere; }
.msg-edited { color: var(--muted); font-size: 11px; }

.reply-line {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 13px;
  position: relative;
}
.reply-line::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 9px;
  width: 30px;
  height: 10px;
  border-left: 2px solid #4e5058;
  border-top: 2px solid #4e5058;
  border-top-left-radius: 6px;
}
.reply-line .name { color: var(--text-2); font-weight: 600; flex: none; }
.reply-line .snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bot-tag {
  display: inline-flex;
  align-items: center;
  height: 15px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  vertical-align: 2px;
}

.md-h1 { font-size: 22px; font-weight: 800; color: var(--text); margin: 6px 0 2px; }
.md-h2 { font-size: 19px; font-weight: 700; color: var(--text); margin: 6px 0 2px; }
.md-h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 4px 0 2px; }
.md-sub { font-size: 12.5px; color: var(--muted); }
.md-list { margin: 2px 0; padding-left: 22px; }
.msg-body strong, .v2 strong, .embed strong { color: var(--text); }
blockquote { margin: 2px 0; padding: 0 0 0 12px; border-left: 4px solid #4e5058; }
.md-code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--bg-deep);
  font: 13px var(--mono);
  color: var(--text);
}
.md-pre {
  margin: 6px 0 2px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-deep);
  color: var(--text-2);
  font: 13px/1.5 var(--mono);
  white-space: pre-wrap;
  max-width: 560px;
}
.mention {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--accent-tint);
  color: var(--mention-fg);
  font-weight: 500;
}
.ts { padding: 0 2px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); }
.emoji { display: inline-block; width: 22px; height: 22px; vertical-align: -5px; object-fit: contain; }
.spoiler { border-radius: 3px; background: #1a1a1a; color: transparent; cursor: pointer; }
.spoiler * { visibility: hidden; }
.spoiler.revealed { background: rgba(255, 255, 255, 0.08); color: inherit; cursor: auto; }
.spoiler.revealed * { visibility: visible; }

.attachments { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 4px; }
.attachment-img {
  max-width: min(400px, 100%);
  max-height: 350px;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  cursor: zoom-in;
}
.attachment-file {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
}
.attachment-file:hover { text-decoration: none; border-color: #4d4d4d; }
.attachment-file svg { flex: none; color: var(--muted); }
.attachment-file .file-name { display: block; color: var(--accent-hover); font-weight: 500; overflow-wrap: anywhere; }
.attachment-file .file-size { display: block; color: var(--muted); font-size: 12px; }
.attachment-file.not-saved .file-name { color: var(--text-2); }

.embed {
  max-width: 520px;
  margin-top: 4px;
  padding: 9px 16px 13px 12px;
  border-left: 4px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-2);
  font-size: 14px;
}
.embed-author { margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--text); }
.embed-title { margin-top: 4px; font-weight: 700; color: var(--text); font-size: 15px; }
.embed-desc { margin-top: 6px; color: var(--text-2); }
.embed-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; margin-top: 10px; }
.embed-field { grid-column: 1 / -1; min-width: 0; }
.embed-field.inline { grid-column: auto; }
.embed-field-name { font-weight: 700; color: var(--text); font-size: 13px; margin-bottom: 1px; }
.embed-field-value { color: var(--text-2); font-size: 13.5px; }
.embed-image { margin-top: 12px; border-radius: 4px; max-height: 300px; }
.embed-footer { margin-top: 10px; color: var(--muted); font-size: 12px; }

/* Discord "Components V2" containers, used by WaveTicket's own messages */
.v2 {
  max-width: 560px;
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 14.5px;
}
.v2-text + .v2-text { margin-top: 8px; }
.v2-sep { margin: 12px 0; border: 0; border-top: 1px solid var(--border-strong); }
.v2-space { height: 12px; }
.v2-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.v2 > .v2-row:first-child { margin-top: 0; }
.v2-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: #4e5058;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
a.v2-btn:hover { text-decoration: none; filter: brightness(1.1); }
.v2-btn--primary { background: var(--accent); }
.v2-btn--success { background: #248046; }
.v2-btn--danger { background: #da373c; }
.v2-btn.is-disabled { opacity: 0.5; }
.v2-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  color: var(--muted);
  font-size: 14px;
}
.v2-section { display: flex; gap: 12px; align-items: flex-start; }
.v2-section > div { flex: 1; min-width: 0; }
.v2-thumb { width: 72px; height: 72px; border-radius: var(--radius-sm); object-fit: cover; }
.v2-gallery { display: flex; flex-wrap: wrap; gap: 6px; }

.day-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.day-divider::before, .day-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }

/* ---------- Lightbox + toast ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 32px;
  background: rgba(0, 0, 0, 0.85);
}
.lightbox.open { display: grid; }
.lightbox figure { margin: 0; text-align: center; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 82vh; border-radius: 4px; }
.lightbox figcaption { margin-top: 10px; font-size: 13px; }
.lightbox figcaption a { color: var(--text-2); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Statistics ---------- */
.stats { transition: opacity 0.15s; }
.stats.is-refreshing [data-stats-body] { opacity: 0.55; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 18px 20px; }
.kpi-top { display: flex; align-items: center; gap: 12px; }
.kpi-label { color: var(--text-2); font-size: 14px; }
.kpi-value { font-size: 26px; font-weight: 800; line-height: 1.2; }
.kpi-delta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}
.kpi-delta > span:first-child { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.kpi-delta > span:only-child { font-weight: 400; }
.delta-good { color: #5fcf85; }
.delta-bad { color: #f27b7f; }
.delta-neutral { color: var(--text-2); }

.chart-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.bars-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card { min-width: 0; padding: 18px 20px 20px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.chart-head h2 { margin: 0; font-size: 16px; font-weight: 800; }
.chart-head-right { display: flex; align-items: center; gap: 8px; }
.total-chip {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
}
.total-chip strong { color: var(--text); }
.col-note { color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

.line-chart { position: relative; }
.line-chart:focus-visible { outline-offset: 4px; }
.line-chart svg { display: block; max-width: 100%; overflow: visible; }
.line-chart .grid { stroke: #383838; stroke-width: 1; }
.line-chart .tick { fill: var(--muted); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.line-chart .crosshair line { stroke: #6a6a6a; stroke-width: 1; }
.chart-tooltip {
  position: absolute;
  z-index: 5;
  padding: 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-deep);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  pointer-events: none;
}
.chart-tooltip strong { display: block; color: var(--text); font-size: 14.5px; }
.chart-table { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.data-table td:last-child, .data-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.donut-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 32px; min-height: 320px; }
.donut { position: relative; }
.donut svg { display: block; }
.donut circle[data-seg] { transition: opacity 0.12s; }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.donut-center strong { font-size: 26px; font-weight: 800; line-height: 1.1; }
.donut-center span { color: var(--muted); font-size: 12.5px; }
.donut-legend { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 14.5px; }
.donut-legend li {
  display: grid;
  grid-template-columns: 12px minmax(56px, auto) 28px 44px;
  align-items: center;
  gap: 8px;
  transition: opacity 0.12s;
}
.donut-legend strong { text-align: right; font-variant-numeric: tabular-nums; }
.donut-legend .muted { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--swatch); }
.dimmed { opacity: 0.35; }

.bar-list { display: flex; flex-direction: column; gap: 16px; margin: 4px 0 0; padding: 0; list-style: none; }
.bar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 14.5px; }
.bar-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-top strong { font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; border-radius: 0 4px 4px 0; background: #3a3a3a; }
.bar-fill { height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; }

.utc-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 22px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- Templates & panels ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
a[aria-disabled="true"] { pointer-events: none; opacity: 0.45; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-danger { background: #da373c; color: #fff; }
.btn-danger:hover { background: #e5484d; }

.input.plain { padding: 0 12px; }
.select.full { width: 100%; max-width: none; }
.textarea {
  display: block;
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  color: var(--text);
  font: 14px/1.5 var(--font);
  resize: vertical;
}
.textarea:focus { outline: none; border-color: var(--accent); }
input[type="number"].input { max-width: 100%; }
.label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}
.label small { color: var(--muted); font-size: 12px; font-weight: 500; }
.label-row { display: flex; justify-content: space-between; gap: 8px; }
.counter { color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.section > .counter { display: block; margin-top: 6px; text-align: right; }
code { padding: 0 4px; border-radius: 4px; background: var(--bg-deep); font: 12px var(--mono); }

.intro-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.intro { margin-bottom: 16px; padding: 22px 24px; }
.intro-grid .intro { margin-bottom: 0; }
.intro h2 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
.intro ol { margin: 0; padding-left: 20px; color: var(--text-2); }
.intro li { margin: 5px 0; }
.feature-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.feature-boxes span {
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 14px;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 16px 20px;
}
.list-head h2 { margin: 0; font-size: 19px; font-weight: 800; }
.list-head h2 span { color: var(--muted); font-weight: 700; }

.notice.subtle { border-color: var(--border-strong); background: var(--surface); }
.notice.subtle > svg { color: var(--muted); }
.notice.warn { border-color: rgba(240, 177, 50, 0.45); background: rgba(240, 177, 50, 0.08); }
.notice.warn > svg { color: var(--warning); }

.item-list { display: flex; flex-direction: column; gap: 10px; }
.item-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; color: var(--text); }
a.item-main:hover { text-decoration: none; }
a.item-main:hover .item-title { text-decoration: underline; }
.item-title { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { color: var(--muted); font-size: 13px; }
.item-actions { display: flex; gap: 8px; flex: none; }
.action-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
}
.action-btn:hover { background: #3a3a3a; color: var(--text); text-decoration: none; }
.action-btn.accent { border-color: var(--accent-line); background: var(--accent-tint); color: #aebbfb; }
.action-btn.accent:hover { background: rgba(95, 120, 246, 0.28); }
.action-btn.danger { border-color: rgba(229, 72, 77, 0.4); background: rgba(229, 72, 77, 0.12); color: #f27b7f; }
.action-btn.danger:hover { background: rgba(229, 72, 77, 0.22); }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.tag {
  padding: 2px 8px;
  border: 1px solid var(--accent-line);
  border-radius: 5px;
  background: var(--accent-tint);
  color: #aebbfb;
  font-size: 12px;
  font-weight: 700;
}
.tag.missing { border-color: var(--border-strong); background: var(--surface-2); color: var(--muted); text-decoration: line-through; }

.editor-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.editor-head h1 { margin: 0; font-size: 24px; font-weight: 800; overflow-wrap: anywhere; }
.editor-head .spacer { flex: 1; }
.back-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
}
.back-btn:hover { background: var(--surface-2); color: var(--text); }
.editor-head + .alert, .notice + .alert { margin-bottom: 16px; }
#form-error { margin-bottom: 16px; }

.editor { margin: 0; padding: 0; border: 0; min-width: 0; }
.section { margin-bottom: 16px; padding: 20px 22px 22px; }
.section h2 { margin: 0 0 14px; font-size: 16px; font-weight: 800; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.section-head h2 { margin: 0; }
.section-desc { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.section-foot { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; }
.questions-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.alert-control { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.alert-wait { display: flex; align-items: center; gap: 8px; }
.alert-wait .input { width: 80px; }

/* Ticket Panel / Ticket Thread tabs in the panel editor */
.tabs {
  display: flex;
  gap: 28px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 2px 12px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tab svg { flex: none; }
.tab:hover { color: var(--text-2); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field {
  min-width: 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.field h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.field > p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }

.switch { position: relative; display: inline-flex; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #4e5058;
  transition: background-color 0.15s;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: 0.6; cursor: not-allowed; }

.segmented { display: inline-flex; gap: 4px; padding: 3px; border-radius: var(--radius-sm); background: var(--bg-deep); width: fit-content; }
.segmented button {
  padding: 5px 12px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.segmented button.on { background: var(--accent); color: #fff; }

.ms-chips, .ms .ms-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip-x {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 4px 3px 9px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.chip-x button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text-2);
  cursor: pointer;
}
.chip-x button:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.chip-x button svg { width: 12px; height: 12px; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--dot, #99aab5); }

.select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
}
.select-btn:hover { border-color: #555; }
.select-btn svg { color: var(--muted); }
.ms-menu { left: 0; right: 0; top: calc(100% + 4px); padding: 8px; }
.ms-menu .input { height: 34px; margin-bottom: 6px; }
.ms-list { max-height: 240px; overflow-y: auto; }
.ms-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.ms-option:hover { background: var(--surface-2); color: var(--text); }
.ms-option.on { color: var(--text); }
.ms-option:disabled { opacity: 0.45; cursor: not-allowed; }
.ms-check {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: #fff;
}
.ms-option.on .ms-check { border-color: var(--accent); background: var(--accent); }
.ms-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-empty { padding: 10px 8px; color: var(--muted); font-size: 13.5px; }

.questions-list { display: flex; flex-direction: column; gap: 12px; }
.question { border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 16px;
  background: var(--surface-2);
}
.question-head h3 { margin: 0; font-size: 14.5px; font-weight: 800; }
.question-head .action-btn { width: 30px; height: 30px; }
.question-body { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.q-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }

.save-bar {
  position: sticky;
  bottom: 16px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(43, 43, 43, 0.96);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.save-bar {
  visibility: hidden;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}
.save-bar.visible { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.save-bar.dirty { border-color: var(--accent-line); }
@media (prefers-reduced-motion: reduce) { .save-bar { transition: none; } }
.save-status { margin-right: auto; color: var(--muted); font-size: 14px; }
.save-bar.dirty .save-status { color: var(--text); font-weight: 600; }

.appearance { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.appearance-form { display: flex; flex-direction: column; gap: 16px; }
.appearance-preview {
  position: sticky;
  top: 20px;
  padding: 16px 18px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.appearance-preview h3 { margin: 0 0 2px; font-size: 15px; font-weight: 700; }
.appearance-preview > p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.discord-preview { padding: 14px; border-radius: var(--radius); background: #313338; }
.preview-msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
.preview-body .v2 { background: #393a41; border-color: #45464d; }
.preview-banner { width: 100%; max-height: 220px; object-fit: cover; margin-bottom: 12px; border-radius: 6px; }
.preview-options { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 130px;
  padding: 18px;
  border: 1.5px dashed #555;
  border-radius: var(--radius);
  background: var(--bg-deep);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.dropzone:hover, .drag .dropzone { border-color: var(--accent); background: rgba(95, 120, 246, 0.06); }
.dropzone svg { color: var(--muted); }
.dropzone small { color: var(--muted); font-size: 12px; }
.banner-box { overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-deep); }
.banner-box img { width: 100%; max-height: 200px; object-fit: cover; }
.banner-actions { display: flex; gap: 8px; margin-top: 8px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
}
.modal { width: 100%; max-width: 420px; padding: 22px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5); }
.modal h2 { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
.modal p { margin: 0 0 20px; color: var(--text-2); font-size: 14.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .list-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 70px; }
  .list-row > .col-date { display: none; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1500px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .intro-grid, .appearance { grid-template-columns: 1fr; }
  .appearance-preview { position: static; }
  .transcript-layout { grid-template-columns: 1fr; }
  .sidebar-card { position: static; }
}

@media (max-width: 860px) {
  .dash { display: block; }
  .dash-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: 272px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .nav-open .dash-sidebar { transform: none; }
  .nav-open .dash-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, 0.5); }
  .dash-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding: 0 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border-strong);
  }
  .dash-topbar .brand { font-size: 17px; }
  .dash-topbar .brand img { width: 26px; height: 26px; }
  .dash-content { padding: 20px 16px 48px; }
}

@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .page-main { padding: 28px 0 48px; }
  .hero { padding: 36px 0 56px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .feature-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 26px; }
  .toolbar, .search { width: 100%; }
  .search { flex: 1; }
  .field-grid, .field-grid.two, .q-grid, .feature-boxes, .bars-grid { grid-template-columns: 1fr; }
  .chart-card { padding: 16px; }
  .section { padding: 16px; }
  .item-row { padding: 14px 16px; }
  .editor-head h1 { font-size: 20px; }
  .editor-head .btn { padding: 0 10px; font-size: 0; gap: 0; }
  .editor-head .btn svg { width: 16px; height: 16px; }

  .list-row--head { display: none; }
  .list-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 16px; padding: 14px 16px; }
  .list-row > .col-ticket { grid-column: 1 / -1; }
  .list-row > .col-date { display: block; }
  .cell-label {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
  }

  .sidebar-card { padding: 2px 16px 16px; }
  .chat { padding: 16px 16px 12px; }
  .msg { grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; margin: 0 -16px; padding: 2px 16px; }
  .msg .avatar { width: 36px; height: 36px; }
  .reply-line::before { left: -30px; width: 24px; }
  .embed-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
