:root {
  --bg: #f7f1e8;
  --bg-accent: #f1e4d0;
  --ink: #1e1b16;
  --muted: #5a5247;
  --accent: #ff6b35;
  --accent-dark: #d24c1f;
  --teal: #1f8a7a;
  --surface: rgba(255, 255, 255, 0.8);
  --stroke: rgba(30, 27, 22, 0.1);
  --shadow: 0 22px 50px rgba(30, 27, 22, 0.15);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff6e7, var(--bg));
  overflow-x: hidden;
}

.bg-shape {
  position: absolute;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.6;
  z-index: 0;
}

.shape-one {
  width: 420px;
  height: 420px;
  background: linear-gradient(140deg, #ffd5b0, #f9b38a);
  top: -140px;
  right: -120px;
}

.shape-two {
  width: 520px;
  height: 520px;
  background: linear-gradient(140deg, #bde8dc, #8fd8c5);
  bottom: -220px;
  left: -160px;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 24px 20px;
}

.hero {
  display: flex;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
  animation: fadeUp 0.8s ease-out;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.lang-switch select {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 12px;
}

.hero h1 {
  font-size: clamp(32px, 4vw, 52px);
  margin: 0 0 12px;
}

.subtitle {
  color: var(--muted);
  max-width: 420px;
  margin: 0;
}

.hero-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  min-width: 280px;
}

.hero-actions {
  display: grid;
  gap: 8px;
  grid-column: span 2;
}

.user-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(140deg, #fff, #f1e4d0);
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-name {
  margin: 0;
  font-weight: 600;
}

.user-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  animation: fadeUp 0.9s ease-out;
}

.panel.full {
  animation-delay: 0.1s;
}

.panel#chat-panel {
  min-height: calc(100vh - 140px);
}

.panel h2 {
  margin: 0 0 12px;
}

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

form {
  display: grid;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  font-family: "Space Grotesk", sans-serif;
}

select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  font-family: "Space Grotesk", sans-serif;
}

textarea {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  font-family: "Space Grotesk", sans-serif;
  resize: vertical;
}

input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button {
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 10px 18px rgba(255, 107, 53, 0.25);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

button:hover {
  transform: translateY(-2px);
  background: var(--accent-dark);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--ink);
  box-shadow: none;
}

button.ghost:hover {
  background: rgba(30, 27, 22, 0.06);
}

button.ghost.danger {
  border-color: rgba(210, 70, 70, 0.4);
  color: #a83737;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.hint.error {
  color: #a83737;
}

.call-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.call-modal-card {
  width: min(900px, 96vw);
  height: min(78vh, 760px);
  min-width: 320px;
  min-height: 320px;
  max-width: 96vw;
  max-height: 92vh;
  resize: both;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.call-video-wrap {
  display: none;
  position: relative;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  overflow: hidden;
  background: #121212;
  flex: 1;
  width: 100%;
  min-height: 220px;
}

.call-video-wrap.active {
  display: block;
}

#call-remote-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #121212;
}

#call-local-video {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: clamp(110px, 24vw, 180px);
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: #1d1d1d;
  object-fit: cover;
}

.call-video-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: #f1f1f1;
  font-size: 14px;
  background: linear-gradient(135deg, #2e2e2e, #171717);
}

.call-video-wrap.no-video .call-video-placeholder {
  display: flex;
}

.call-video-wrap.no-video #call-remote-video {
  opacity: 0;
}

.call-media-controls {
  display: none;
  gap: 10px;
  flex-wrap: wrap;
}

.call-participants {
  display: none;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.64);
}

.call-participants-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.call-participants-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.call-participant-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 62px;
}

.call-participant-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(88, 88, 88, 0.35);
  background: #f4f4f4;
  color: #232323;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.call-participant-item.speaking .call-participant-avatar {
  border-color: #2bb24b;
  box-shadow: 0 0 0 2px rgba(43, 178, 75, 0.25);
  transform: scale(1.03);
}

.call-participant-label {
  font-size: 11px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}

#remote-audio {
  display: none;
}

.call-minimized {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: none;
  align-items: center;
  gap: 10px;
  min-width: min(360px, calc(100vw - 28px));
  max-width: min(420px, calc(100vw - 28px));
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 34px rgba(22, 20, 16, 0.2);
}

.call-minimized.active {
  display: flex;
}

.call-minimized-text {
  min-width: 0;
  flex: 1;
}

.call-minimized-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-minimized-status {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-minimized button {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .call-minimized {
    right: 10px;
    bottom: 10px;
    min-width: min(360px, calc(100vw - 20px));
    max-width: min(420px, calc(100vw - 20px));
  }
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 18px;
}

.form-row {
  margin-bottom: 16px;
}

.new-chat-panel {
  display: none;
  margin-top: 12px;
  gap: 14px;
}

.new-chat-panel.active {
  display: grid;
}

.chat-list {
  display: grid;
  gap: 8px;
}

.chat-sidebar {
  display: grid;
  gap: 16px;
}

.chat-card {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(30, 27, 22, 0.12);
}

.chat-card.active {
  border-color: rgba(31, 138, 122, 0.4);
  box-shadow: 0 0 0 2px rgba(31, 138, 122, 0.15);
}

.chat-card .chat-title {
  font-weight: 600;
}

.chat-info {
  flex: 1;
  display: grid;
  gap: 4px;
}

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

.chat-row-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.chat-unread {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e63946;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
}

.chat-mentions {
  min-width: 24px;
  height: 20px;
  border-radius: 999px;
  background: #f6b73c;
  color: #1e1b16;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
}

.chat-view {
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--stroke);
  display: grid;
  gap: 12px;
}

.chat-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(140deg, #fff, #f1e4d0);
  display: grid;
  place-items: center;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
}

.chat-avatar.button {
  cursor: pointer;
  border: 1px solid rgba(30, 27, 22, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-avatar.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(30, 27, 22, 0.15);
}

.chat-action-menu {
  position: fixed;
  z-index: 25;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
  box-shadow: var(--shadow);
  min-width: 160px;
}

.chat-action-info {
  display: grid;
  gap: 6px;
  padding: 8px 6px 10px;
  border-bottom: 1px solid var(--stroke);
  margin-bottom: 6px;
}

.chat-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  gap: 10px;
}

.chat-action-label {
  color: var(--ink);
  font-weight: 600;
}

.chat-action-menu .chat-action-link {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: inherit;
  box-shadow: none;
}

.chat-action-menu .chat-action-link:hover {
  color: var(--teal);
  background: none;
}

.chat-action-menu.active {
  display: flex;
}

.chat-action-menu button {
  border: none;
  background: rgba(247, 241, 232, 0.8);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
}

.chat-action-menu button:hover {
  background: rgba(31, 138, 122, 0.15);
}

.chat-action-menu .danger {
  color: #b53a3a;
}

.group-user-list {
  display: grid;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}

.group-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 13px;
}

.group-user-item:hover {
  background: rgba(31, 138, 122, 0.12);
}

#markup-toggle {
  color: #1b1b1b;
  font-weight: 700;
}

.poll-options-editor {
  display: grid;
  gap: 8px;
}

.poll-option-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.poll-option-row input {
  flex: 1;
}

.poll-remove-option {
  border: none;
  background: rgba(229, 86, 86, 0.12);
  color: #b53a3a;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.poll-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(247, 241, 232, 0.65);
}

.poll-question {
  font-weight: 600;
}

.poll-options {
  display: grid;
  gap: 8px;
}

.poll-option-btn {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.poll-option-btn:hover {
  background: rgba(31, 138, 122, 0.12);
}

.poll-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.poll-results {
  display: none;
  gap: 8px;
  padding-top: 8px;
}

.poll-results.active {
  display: grid;
}

.poll-result-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  align-items: center;
  gap: 10px;
}

.poll-result-text {
  font-size: 12px;
  color: var(--ink);
}

.poll-result-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(30, 27, 22, 0.08);
  overflow: hidden;
}

.poll-result-fill {
  height: 100%;
  background: rgba(31, 138, 122, 0.55);
  border-radius: 999px;
  min-width: 2px;
  transition: width 0.2s ease;
}

.poll-voters {
  display: none;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--stroke);
}

.poll-voters.active {
  display: flex;
}

.poll-voter {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 4px 8px 4px 4px;
  font-size: 11px;
}

.poll-voter-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(140deg, #fff, #f1e4d0);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  overflow: hidden;
}

.poll-voter-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.todo-items-editor {
  display: grid;
  gap: 8px;
}

.todo-item-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.todo-item-row input {
  flex: 1;
}

.todo-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(247, 241, 232, 0.65);
}

.todo-title {
  font-weight: 600;
}

.todo-list {
  display: grid;
  gap: 8px;
}

.todo-task {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
  font-size: 13px;
}

.todo-task.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.todo-task.disabled .todo-status {
  cursor: not-allowed;
}

.todo-status {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.todo-brick {
  background: #d44646;
  position: relative;
  border-radius: 50%;
}

.todo-brick::before,
.todo-brick::after {
  content: "";
  position: absolute;
  width: 70%;
  height: 4px;
  background: #fff;
  opacity: 0.9;
  left: 15%;
}

.todo-brick::before {
  top: 50%;
  transform: translateY(-50%);
}

.todo-brick::after {
  display: none;
}

.todo-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(140deg, #fff, #f1e4d0);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.todo-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.todo-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.todo-avatars {
  display: flex;
  gap: 4px;
}

.todo-count {
  border: none;
  background: rgba(31, 138, 122, 0.12);
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}

.todo-tooltip {
  display: none;
  position: absolute;
  right: 0;
  top: 26px;
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px;
  box-shadow: var(--shadow);
  z-index: 5;
  min-width: 200px;
  max-height: 220px;
  overflow-y: auto;
}

.todo-tooltip.active {
  display: grid;
  gap: 6px;
}

.todo-tooltip-item {
  border: none;
  background: rgba(247, 241, 232, 0.8);
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}

.todo-tooltip-item:hover {
  background: rgba(31, 138, 122, 0.15);
}

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

.chat-view-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.chat-view h3 {
  margin: 0;
}

.message-list {
  min-height: 180px;
  max-height: clamp(260px, 45vh, 520px);
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(247, 241, 232, 0.8);
}

.pinned-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(31, 138, 122, 0.4);
  background: rgba(31, 138, 122, 0.08);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}

.pinned-bar.active {
  display: flex;
}

.message-item {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--stroke);
}

.message-item.me {
  background: rgba(31, 138, 122, 0.12);
  border-color: rgba(31, 138, 122, 0.2);
}

.message-item.system {
  background: rgba(255, 235, 179, 0.4);
  border-color: rgba(255, 193, 7, 0.4);
}

.message-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.message-edited {
  font-size: 11px;
  color: rgba(47, 43, 38, 0.65);
}

.message-reply {
  padding: 6px 8px;
  border-left: 3px solid rgba(31, 138, 122, 0.5);
  background: rgba(247, 241, 232, 0.7);
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
}

.status-check {
  margin-left: 6px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: pointer;
}

.status-check.delivered {
  color: #ffffff;
  background: #6b645a;
}

.status-check.read {
  color: #2f6fed;
  background: transparent;
}

.message-body {
  font-size: 14px;
}

.group-call-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(31, 138, 122, 0.35);
  background: rgba(31, 138, 122, 0.08);
}

.group-call-title {
  font-weight: 600;
  color: var(--ink);
}

.group-call-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.group-call-join {
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(30, 27, 22, 0.2);
  background: #ffffff;
  color: #111111;
  box-shadow: none;
}

.group-call-join:hover {
  background: rgba(31, 138, 122, 0.14);
  transform: none;
}

.msg-bold {
  font-weight: 700;
}

.msg-underline {
  text-decoration: underline;
}

.msg-understrike {
  text-decoration: underline line-through;
}

.msg-strike {
  text-decoration: line-through;
}

.msg-code {
  font-family: "IBM Plex Mono", monospace;
  background: rgba(31, 138, 122, 0.12);
  border: 1px solid rgba(31, 138, 122, 0.2);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 13px;
  white-space: pre-wrap;
}

.msg-spoiler {
  background: rgba(30, 27, 22, 0.08);
  border-radius: 6px;
  padding: 2px 6px;
  filter: blur(4px);
  cursor: pointer;
}

.msg-spoiler.revealed {
  filter: none;
}

.msg-big {
  font-size: 1.9em;
  font-weight: 600;
  line-height: 1.2;
}

.markup-menu {
  min-width: 180px;
}

.message-body a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
}

.message-body a:hover {
  text-decoration: underline;
}

.message-media {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke);
}

.message-media.video-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(31, 138, 122, 0.2);
}

.message-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.72);
}

.message-file-info {
  min-width: 0;
}

.message-file-name {
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
}

.message-file-size {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.mention {
  background: rgba(31, 138, 122, 0.15);
  color: #0f5c52;
  padding: 0 4px;
  border-radius: 6px;
  font-weight: 600;
}

.message-form {
  position: relative;
}

.message-action-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.9);
  margin-bottom: 8px;
  font-size: 12px;
}

.message-action-bar.active {
  display: flex;
}

.agreement-banner {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(210, 70, 70, 0.3);
  background: rgba(210, 70, 70, 0.08);
  font-size: 12px;
  color: #7a2f2f;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.agreement-banner.active {
  display: flex;
}

.agreement-banner a {
  color: #7a2f2f;
  font-weight: 600;
  text-decoration: none;
}

.agreement-banner a:hover {
  text-decoration: underline;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  position: relative;
}

.mention-suggestions {
  position: absolute;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
  box-shadow: var(--shadow);
  max-height: 200px;
  overflow-y: auto;
  z-index: 8;
}

.mention-suggestions.active {
  display: flex;
}

.mention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(247, 241, 232, 0.9);
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}

.mention-item.active,
.mention-item:hover {
  background: rgba(31, 138, 122, 0.16);
}

.mention-item .mention-name {
  color: var(--muted);
  font-size: 12px;
}

.message-more {
  position: relative;
  display: flex;
  align-items: center;
}

.message-more-panel {
  position: absolute;
  left: 0;
  bottom: 48px;
  display: none;
  grid-template-columns: repeat(3, 38px);
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 6;
}

.message-more-panel.active {
  display: grid;
}

.record-preview {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(247, 241, 232, 0.9);
}

.record-preview.active {
  display: flex;
}

.record-preview video {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(31, 138, 122, 0.2);
  background: #000;
}

.switch-btn {
  font-size: 18px;
}

.message-menu {
  position: fixed;
  z-index: 20;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
  box-shadow: var(--shadow);
  min-width: 140px;
}

.message-menu.active {
  display: flex;
}

.message-menu button {
  border: none;
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(30, 27, 22, 0.08);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
}

.message-menu button:hover {
  background: rgba(31, 138, 122, 0.15);
}

.message-menu .danger {
  color: #b53a3a;
}

.read-receipts {
  min-width: 220px;
}

.read-receipt-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--ink);
  background: rgba(247, 241, 232, 0.8);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(30, 27, 22, 0.08);
}

.read-receipt-item span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.member-list {
  display: grid;
  gap: 8px;
}

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(247, 241, 232, 0.8);
  font-size: 13px;
}

.member-row button {
  padding: 6px 10px;
  font-size: 12px;
  box-shadow: none;
}

.forward-list {
  display: grid;
  gap: 8px;
}

.forward-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(247, 241, 232, 0.8);
  cursor: pointer;
}

.forward-item:hover {
  background: rgba(31, 138, 122, 0.12);
}

.message-input {
  flex: 1;
  min-height: 42px;
  max-height: 160px;
  line-height: 1.4;
  resize: none;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--ink);
}

.icon-btn:hover {
  background: rgba(31, 138, 122, 0.12);
  transform: translateY(-1px);
}

.send-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 10px 18px rgba(255, 107, 53, 0.25);
}

.send-btn:hover {
  background: var(--accent-dark);
}

.record-btn {
  color: #d24646;
  font-size: 18px;
}

.record-btn.recording {
  background: #d24646;
  color: #fff;
  border-color: #d24646;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(210, 70, 70, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(210, 70, 70, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(210, 70, 70, 0);
  }
}

.attach-input {
  display: none;
}

.emoji-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  display: none;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 7;
}

.emoji-panel.active {
  display: grid;
}

.emoji-item {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: rgba(247, 241, 232, 0.8);
  font-size: 16px;
  cursor: pointer;
  box-shadow: none;
  padding: 0;
}

.emoji-item:hover {
  background: rgba(31, 138, 122, 0.2);
}
.typing-indicator {
  min-height: 18px;
  margin: 0;
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 27, 22, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
}

.modal.active {
  display: flex;
}

.modal-card {
  width: min(520px, 90vw);
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-table {
  display: grid;
  gap: 8px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-tools {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin-tools.active {
  display: grid;
}

.admin-tools form {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.admin-tools h3 {
  margin: 0;
  font-size: 16px;
}

.admin-tools code {
  color: var(--ink);
  background: rgba(247, 241, 232, 0.9);
  border-radius: 6px;
  padding: 1px 5px;
}

.admin-import-errors {
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
}

.admin-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.9fr 0.9fr 1.2fr 0.6fr;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  cursor: pointer;
}

.admin-row.header {
  font-weight: 600;
  background: rgba(247, 241, 232, 0.9);
  cursor: default;
}

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

.add-members-form {
  display: grid;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed var(--stroke);
  background: rgba(255, 255, 255, 0.85);
}

.suggestions {
  display: none;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

.suggestion-item {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  box-shadow: none;
}

.suggestion-item:hover {
  background: rgba(31, 138, 122, 0.12);
}

.member-pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(31, 138, 122, 0.14);
  color: #135a4f;
  font-size: 12px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }

  .emoji-panel {
    grid-template-columns: repeat(6, 1fr);
    left: 0;
    right: 0;
  }
}

@media (max-width: 600px) {
  .shell {
    padding: 40px 18px 20px;
  }

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

  .hero-actions button {
    width: 100%;
  }
}
