:root {
  --bg: #f6efe7;
  --panel: rgba(255, 252, 248, 0.92);
  --line: rgba(109, 73, 38, 0.15);
  --ink: #2b1d12;
  --muted: #715640;
  --accent: #c96b32;
  --accent-dark: #a34e1e;
  --shadow: 0 30px 80px rgba(92, 56, 28, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 215, 176, 0.9), transparent 28%),
    radial-gradient(circle at bottom right, rgba(210, 130, 76, 0.24), transparent 30%),
    linear-gradient(135deg, #f9f4ed, var(--bg));
}

.support-shell,
.login-shell,
.single-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.single-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 0;
}

.single-panel {
  width: min(720px, 100%);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.eyebrow,
.subtitle,
.chat-head p,
label span,
.intro,
.queue-label {
  color: var(--muted);
}

.welcome-title,
.login-title {
  margin: 0;
  font-size: clamp(42px, 9vw, 84px);
  line-height: 0.96;
}

.login-title {
  font-size: clamp(30px, 7vw, 52px);
}

.queue-inline,
.support-queue-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.queue-inline {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(109, 73, 38, 0.1);
}

.queue-extra {
  font-style: normal;
  color: var(--muted);
  margin-left: 8px;
}

.queue-value {
  display: block;
  margin-top: 6px;
  font-size: clamp(24px, 5vw, 36px);
}

.join-form,
.message-form,
.chat-app,
label {
  display: grid;
  gap: 16px;
}

.composer {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

input,
button {
  border: 0;
  border-radius: 16px;
  font: inherit;
}

input {
  width: 100%;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(109, 73, 38, 0.12);
}

button {
  padding: 14px 18px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.ghost,
.session-item,
.upload-btn {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.ghost:disabled {
  cursor: not-allowed;
  color: rgba(43, 29, 18, 0.38);
  background: rgba(255, 255, 255, 0.72);
}

.upload-btn {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  cursor: pointer;
}

.upload-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.chat-actions {
  display: flex;
  gap: 12px;
}

.messages {
  height: 420px;
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 8px 2px;
}

.chat-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.chat-row.self {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: #6c4b34;
  background: linear-gradient(135deg, #f8dcc8, #fff6ef);
  border: 1px solid rgba(109, 73, 38, 0.12);
}

.chat-card {
  max-width: min(78%, 460px);
}

.sender-name {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
}

.chat-row.self .sender-name {
  text-align: right;
}

.chat-bubble {
  padding: 12px 14px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(95, 63, 36, 0.06);
}

.chat-row.self .chat-bubble {
  background: linear-gradient(135deg, #cfeaff, #aedaef);
  border-top-right-radius: 6px;
}

.chat-row.other .chat-bubble {
  border-top-left-radius: 6px;
}

.chat-bubble p {
  margin: 0;
  line-height: 1.6;
}

.chat-image {
  display: block;
  max-width: min(280px, 100%);
  border-radius: 14px;
  margin: 0;
}

.image-caption {
  margin-top: 8px !important;
  color: var(--muted);
  font-size: 13px;
}

.support-body {
  padding: 24px 0;
}

.support-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

.support-sidebar,
.support-main {
  min-height: 80vh;
}

.session-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.session-item {
  text-align: left;
}

.session-item span,
.session-item p {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.session-item.active {
  border-color: rgba(201, 107, 50, 0.5);
  box-shadow: inset 0 0 0 1px rgba(201, 107, 50, 0.25);
}

.paste-preview {
  margin: 8px 0 14px;
}

.paste-preview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(109, 73, 38, 0.12);
}

.paste-preview-image {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 14px;
  flex: 0 0 68px;
}

.paste-preview-meta {
  min-width: 0;
  flex: 1;
}

.paste-preview-meta strong,
.paste-preview-meta p {
  display: block;
  margin: 0;
}

.paste-preview-meta p {
  margin-top: 6px;
  color: var(--muted);
  word-break: break-all;
}

.preview-remove {
  padding: 10px 14px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(43, 29, 18, 0.18);
  padding: 16px;
}

.modal-card {
  width: min(520px, 100%);
}

.entry-actions {
  display: grid;
  gap: 14px;
}

.action-card {
  min-height: 58px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(520px, 100%);
}

.error-text {
  margin: 0;
  color: #c0392b;
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .support-shell {
    grid-template-columns: 1fr;
  }

  .queue-inline,
  .support-queue-board {
    grid-template-columns: 1fr;
  }

  .composer {
    grid-template-columns: auto 1fr;
  }

  .composer button:last-child {
    grid-column: 1 / -1;
  }

  .chat-card {
    max-width: 100%;
  }

  .chat-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
