﻿:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --surface: #ffffff;
  --ink: #1c1c1c;
  --muted: #5f5f5f;
  --accent: #c4ef17;
  --accent-2: #1c1c1c;
  --accent-3: #fefffa;
  --line: #e3e6dd;
  --shadow: 0 20px 60px rgba(29, 26, 23, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

img,
video,
iframe,
svg {
  max-width: 100%;
  height: auto;
}

/* Prevent horizontal scroll on all elements */
.container,
.page,
.panel,
.card,
.chat-window,
.chat-bubble,
.attachment,
.attachment-doc,
.message-text,
.search-container,
.drop-zone,
section,
main {
  max-width: 100%;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(120deg, #f6f7f3 0%, #eef2ea 55%, #f9faee 100%);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(196, 239, 23, 0.12), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(28, 28, 28, 0.05), transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(196, 239, 23, 0.06), transparent 55%);
  pointer-events: none;
  z-index: -1;
}

h1,
h2,
.brand-text {
  font-family: "Fraunces", "Georgia", serif;
  margin: 0;
}

p {
  margin: 0;
}

label {
  font-size: 0.85rem;
  color: var(--muted);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1100px, 100% - 48px);
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(222, 111, 77, 0.2);
}

.nav-quiet {
  align-items: center;
  display: flex;
  gap: 18px;
  font-size: 0.9rem;
  color: var(--muted);
}

.nav-quiet a {
  color: inherit;
  text-decoration: none;
  font-size: inherit;
}

.nav-quiet a:hover {
  text-decoration: underline;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: center;
  padding: 32px 0 40px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent-2);
  margin-bottom: 12px;
}

.hero-copy h1 {
  font-size: clamp(2.3rem, 3.2vw, 3.3rem);
  line-height: 1.05;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.6;
}

.current-chat {
  font-size: 0.95rem;
  color: var(--muted);
}

.current-chat span {
  color: var(--ink);
  font-weight: 600;
}

.upload-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

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

.upload-head h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.upload-head p {
  color: var(--muted);
  font-size: 0.95rem;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--accent-2);
  background: rgba(46, 106, 130, 0.08);
}

.drop-zone {
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  background: #fbfaf8;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.drop-zone.is-dragover {
  border-color: var(--accent);
  background: #fdf4f0;
}

.drop-zone.is-uploading {
  border-color: var(--accent-2);
  background: #eef6f5;
  box-shadow: 0 0 0 4px rgba(46, 106, 130, 0.12);
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(46, 106, 130, 0.15), rgba(222, 111, 77, 0.15));
  transition: width 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

.drop-zone.is-uploading::before {
  width: var(--upload-progress, 0%);
}

.drop-zone.has-file {
  border-color: var(--accent-2);
  background: #f3f6f6;
  box-shadow: 0 0 0 3px rgba(46, 106, 130, 0.12);
}

.drop-zone.is-uploaded {
  border-color: var(--accent);
  background: #fff1ec;
  box-shadow: 0 0 0 4px rgba(222, 111, 77, 0.18);
}

.drop-content {
  position: relative;
  z-index: 1;
}

.drop-title {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.drop-sub {
  font-size: 0.9rem;
  color: var(--muted);
}

.btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.small {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-size: clamp(0.7rem, 2vw, 0.8rem);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--accent-2);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(222, 111, 77, 0.2);
}

.status {
  font-size: 0.9rem;
  color: var(--muted);
}

.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.upload-progress {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

.upload-progress.is-visible {
  display: inline-flex;
}

.progress-shell {
  flex: 1;
  min-width: 140px;
  height: 6px;
  background: #f1ece6;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.2s ease;
}

.progress-percent {
  min-width: 38px;
  text-align: right;
}

.status.error {
  color: var(--ink);
}

.status.success {
  color: var(--ink);
}

.status.warning {
  color: var(--ink);
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(46, 106, 130, 0.2);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.spinner.is-visible {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 16px rgba(222, 111, 77, 0.15);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(222, 111, 77, 0.35);
  }
}

.note {
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--muted);
}

.share-tip {
  margin-top: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(46, 106, 130, 0.08), rgba(46, 106, 130, 0.05));
  border: 1px solid rgba(46, 106, 130, 0.2);
  border-radius: 12px;
  cursor: pointer;
}

.share-tip summary {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.share-tip summary::-webkit-details-marker {
  display: none;
}

.share-tip[open] summary {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(46, 106, 130, 0.15);
}

.share-steps {
  margin: 12px 0;
  padding-left: 20px;
  font-size: 0.85rem;
  line-height: 1.6;
}

.share-steps li {
  margin-bottom: 8px;
  color: var(--ink);
}

.share-steps strong {
  color: var(--accent-2);
  font-weight: 600;
}

.share-note {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

.help-btn {
  align-self: flex-start;
  font-size: 0.85rem;
}

.privacy-callout {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--accent-3);
  display: grid;
  gap: 8px;
  font-size: 0.85rem;
}

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

.privacy-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.privacy-link {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.privacy-link:hover {
  text-decoration: underline;
}

.panel {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 12px 40px rgba(31, 26, 22, 0.05);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.panel+.panel {
  /* margin-top: 18px; */
}

.grid.two-col>.panel {
  height: 100%;
}

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

.panel-header h2 {
  font-size: 1.35rem;
}

.panel-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 6px;
}

.panel-note {
  font-size: 0.9rem;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  background: #fff;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 600;
}

.stat-desc {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.grid.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
  align-items: stretch;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 180px;
  padding: 12px 8px 6px;
  border-radius: var(--radius-md);
  background: #fbfaf8;
  border: 1px solid var(--line);
}

.bar-chart.compact {
  height: 140px;
}

.bar {
  flex: 1;
  min-width: 8px;
  background: linear-gradient(180deg, var(--accent) 0%, #d4583c 100%);
  border-radius: 6px 6px 3px 3px;
  height: calc(var(--value) * 100%);
  transform-origin: bottom;
  transform: scaleY(0.2);
  transition: transform 0.6s ease;
}

.bar.alt {
  background: linear-gradient(180deg, var(--accent-2) 0%, #2b5568 100%);
}

.chart-ready .bar {
  transform: scaleY(1);
}

.participants {
  display: grid;
  gap: 14px;
}

.person {
  display: grid;
  gap: 8px;
}

.person-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: var(--ink);
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #f1ece6;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(222, 111, 77, 0.9), rgba(46, 106, 130, 0.85));
}

.file-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.85rem;
  color: var(--muted);
}

.tag strong {
  color: var(--ink);
}

.file-list {
  display: grid;
  gap: 12px;
}

.file-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
}

.file-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.file-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.file-type {
  align-self: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(46, 106, 130, 0.1);
  color: var(--accent-2);
  text-transform: uppercase;
}

.timeline {
  display: grid;
  gap: 12px;
}

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

.timeline-date {
  font-size: 0.8rem;
  color: var(--muted);
}

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

.faq-answer {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: #f7f5f0;
  border: 1px solid var(--line);
  margin-bottom: 14px;
}

.chat-identity {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, #c4e0dd, #f2d5c6);
  border: 1px solid rgba(46, 106, 130, 0.2);
}

.chat-title {
  font-weight: 600;
  font-size: 1rem;
}

.chat-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.chat-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  border: none;
  background: transparent;
  padding: 6px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.icon-btn:hover {
  background: rgba(46, 106, 130, 0.08);
  color: var(--accent-2);
}

.icon-btn.is-active {
  background: rgba(222, 111, 77, 0.12);
  color: var(--accent);
}

.chat-controls select {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: #fff;
  font-size: 0.85rem;
  color: var(--ink);
}

.chat-window {
  background-color: #0b141a;
  border-radius: var(--radius-md);
  border: 1px solid #1f2c34;
  padding: 20px;
  height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'%3E%3Cdefs%3E%3Cstyle%3E.i%7Bfill:%231e2a30;fill-opacity:0.9;stroke:%231e2a30;stroke-width:0.5%7D%3C/style%3E%3C/defs%3E%3Cg class='i'%3E%3Cpath d='M20 15c0-2.8 2.2-5 5-5h10v3H25c-1.1 0-2 .9-2 2v7h-3v-7zM375 15c0-2.8-2.2-5-5-5h-10v3h10c1.1 0 2 .9 2 2v7h3v-7z'/%3E%3Ccircle cx='50' cy='50' r='8'/%3E%3Ccircle cx='150' cy='30' r='5'/%3E%3Ccircle cx='250' cy='60' r='6'/%3E%3Ccircle cx='350' cy='40' r='7'/%3E%3Cpath d='M80 80l10 10M85 80l-10 10'/%3E%3Crect x='120' y='70' width='15' height='20' rx='3'/%3E%3Cpath d='M180 90c5-10 15-10 20 0'/%3E%3Ccircle cx='320' cy='85' r='10'/%3E%3Cpath d='M315 82v6M320 79v12M325 82v6'/%3E%3Cpath d='M30 130h20v15H30z'/%3E%3Ccircle cx='40' cy='120' r='5'/%3E%3Cpath d='M90 120l15 20-15 20'/%3E%3Crect x='140' y='115' width='25' height='18' rx='2'/%3E%3Cpath d='M145 120h15M145 125h12M145 130h8'/%3E%3Ccircle cx='220' cy='130' r='12'/%3E%3Cpath d='M215 130l5 5 8-10'/%3E%3Cpath d='M280 115v25l12-12z'/%3E%3Ccircle cx='350' cy='130' r='8'/%3E%3Cpath d='M345 127l5 3-5 3z'/%3E%3Cpath d='M25 180c10-5 20 5 30 0'/%3E%3Crect x='70' y='170' width='20' height='25' rx='3'/%3E%3Cpath d='M72 175h16M72 180h16M72 185h10'/%3E%3Ccircle cx='140' cy='185' r='10'/%3E%3Cpath d='M135 185h10M140 180v10'/%3E%3Cpath d='M200 170l10 15-10 15h20l-10-15 10-15z'/%3E%3Crect x='260' y='172' width='22' height='16' rx='8'/%3E%3Ccircle cx='340' cy='180' r='12'/%3E%3Cpath d='M334 176l6 4-6 4M340 176l6 4-6 4'/%3E%3Cpath d='M40 240l-10 10 10 10 10-10z'/%3E%3Ccircle cx='100' cy='245' r='8'/%3E%3Cpath d='M95 242l5 6 8-9'/%3E%3Cpath d='M150 230v20M140 240h20'/%3E%3Crect x='195' y='235' width='18' height='22' rx='9'/%3E%3Cpath d='M270 235c0 15 20 15 20 0M270 255c0-15 20-15 20 0'/%3E%3Ccircle cx='350' cy='245' r='10'/%3E%3Cpath d='M344 245h12'/%3E%3Cpath d='M30 300h15v20H30zM33 303h9v5H33z'/%3E%3Ccircle cx='90' cy='310' r='8'/%3E%3Cpath d='M86 306v8l7-4z'/%3E%3Cpath d='M140 295l15 15-15 15'/%3E%3Cpath d='M155 295l-15 15 15 15'/%3E%3Crect x='200' y='300' width='20' height='15' rx='2'/%3E%3Cpath d='M205 305h10M205 310h7'/%3E%3Ccircle cx='280' cy='305' r='12'/%3E%3Cpath d='M274 305c0-5 12-5 12 0s-12 5-12 0'/%3E%3Cpath d='M340 295v20M350 295v20M345 300v10'/%3E%3Crect x='25' y='355' width='25' height='18' rx='3'/%3E%3Cpath d='M30 360l8 5-8 5'/%3E%3Ccircle cx='100' cy='365' r='10'/%3E%3Cpath d='M95 362v6M100 360v10M105 362v6'/%3E%3Cpath d='M150 355h20l-10 20z'/%3E%3Crect x='210' y='358' width='15' height='15' rx='2'/%3E%3Cpath d='M213 363h9M213 368h6'/%3E%3Ccircle cx='290' cy='365' r='12'/%3E%3Cpath d='M284 365h12M290 359v12'/%3E%3Cpath d='M350 355l10 10M360 355l-10 10M350 365l10 10M360 365l-10 10'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 500px 500px;
}

.chat-row {
  display: flex;
}

.chat-row.incoming {
  justify-content: flex-start;
}

.chat-row.outgoing {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(70%, 520px);
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(31, 26, 22, 0.08);
  overflow: hidden;
  box-sizing: border-box;
}

.chat-bubble.outgoing {
  background: #dcf8c6;
}

.sender-label {
  font-size: 0.75rem;
  color: var(--accent-2);
  margin-bottom: 4px;
}

.message-text {
  white-space: pre-wrap;
  font-size: 0.95rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.chat-meta {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 6px;
  text-align: right;
}

.chat-system {
  align-self: center;
  background: #f7f1e7;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
}

.date-chip {
  align-self: center;
  background: #f8f4ef;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 999px;
}

.attachment {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.8);
  display: grid;
  gap: 4px;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.attachment a {
  color: inherit;
  text-decoration: none;
}

.attachment a:hover {
  text-decoration: underline;
}

.attachment-media {
  width: 100%;
  max-width: 280px;
  border-radius: 12px;
  display: block;
  cursor: pointer;
}

.attachment-audio {
  width: 100%;
  max-width: 280px;
  height: 54px;
}

/* WhatsApp-style Audio Player */
.audio-player {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #d9fdd3;
  border-radius: 8px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.audio-play-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  border: none;
  background: #00a884;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.audio-play-btn:hover {
  background: #008f72;
}

.audio-play-btn:active {
  transform: scale(0.95);
}

.audio-play-btn svg {
  width: 16px;
  height: 16px;
}

.audio-waveform {
  flex: 1;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 1px;
  position: relative;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}

.audio-bar {
  flex: 1;
  min-width: 2px;
  max-width: 4px;
  background: #8696a0;
  border-radius: 1px;
  transition: background 0.15s ease;
}

.audio-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 1px;
}

.audio-progress::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #00a884;
}

.audio-waveform:hover .audio-bar {
  background: #667781;
}

.audio-time {
  font-size: 0.65rem;
  color: #667781;
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Hide the actual audio element */
.audio-player audio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Incoming messages (other person's bubble) */
.chat-bubble:not(.outgoing) .audio-player {
  background: #202c33;
}

.chat-bubble:not(.outgoing) .audio-bar {
  background: #8696a0;
}

.chat-bubble:not(.outgoing) .audio-time {
  color: #aebac1;
}

/* Light mode site-wide - incoming messages still dark, outgoing light green */
body:not(.dark-mode) .chat-bubble.outgoing .audio-player {
  background: #d9fdd3;
}

body:not(.dark-mode) .chat-bubble.outgoing .audio-bar {
  background: #8696a0;
}

body:not(.dark-mode) .chat-bubble.outgoing .audio-time {
  color: #667781;
}

/* Dark mode site-wide */
body.dark-mode .audio-player {
  background: #1f2c34;
}

body.dark-mode .audio-bar {
  background: #5a6670;
}

body.dark-mode .audio-time {
  color: #8696a0;
}

body.dark-mode .chat-bubble.outgoing .audio-player {
  background: #005c4b;
}

body.dark-mode .chat-bubble.outgoing .audio-bar {
  background: #5fb7a6;
}

body.dark-mode .chat-bubble.outgoing .audio-time {
  color: #8bc9bc;
}

body.dark-mode .audio-progress::before {
  background: #00a884;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .audio-player {
    padding: 5px 8px;
    gap: 6px;
  }

  .audio-play-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .audio-play-btn svg {
    width: 14px;
    height: 14px;
  }

  .audio-waveform {
    height: 20px;
  }

  .audio-bar {
    min-width: 2px;
    max-width: 3px;
  }

  .audio-time {
    font-size: 0.6rem;
    min-width: 24px;
  }
}

.attachment-caption {
  font-size: 0.75rem;
  color: var(--muted);
}

.attachment-error {
  color: #b54b3b;
}

.attachment-warning {
  color: #b26a2a;
}

.attachment-warning.success {
  color: #2a8c4a;
}

.attachment-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.attachment-convert-btn,
.attachment-download-link {
  display: inline-block;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.attachment-convert-btn:hover,
.attachment-download-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: #f8f9fa;
  border-color: var(--accent-2);
}

.attachment-convert-btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.attachment-doc {
  display: grid;
  gap: 6px;
}

.attachment-doc-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.attachment-doc-icon {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 8px;
  border-radius: 999px;
  background: #f4eee7;
  border: 1px solid var(--line);
  color: var(--accent-2);
  flex-shrink: 0;
}

.attachment-doc-info {
  display: grid;
  gap: 4px;
}

.attachment-doc-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.attachment-doc-name a {
  color: inherit;
  text-decoration: none;
}

.attachment-doc-name a:hover {
  text-decoration: underline;
}

.attachment-doc-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.attachment-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.attachment-title a {
  color: inherit;
  text-decoration: none;
}

.attachment-title a:hover {
  text-decoration: underline;
}

.attachment-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.chat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.chat-composer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f7f5f0;
  border: 1px solid var(--line);
}

.composer-pill {
  color: var(--muted);
  font-size: 0.9rem;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(13, 16, 19, 0.7);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 50;
}

.media-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.media-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 20px;
  gap: 12px;
  background: rgba(18, 21, 24, 0.95);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  max-width: min(92vw, 980px);
  max-height: 88vh;
}

.media-content {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  display: block;
  background: #0b0b0b;
}

.media-close {
  position: absolute;
  top: 18px;
  right: 18px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
}

.media-download {
  position: absolute;
  top: 18px;
  right: 64px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.media-download:hover {
  background: #fff;
}

.site-footer {
  padding: 36px 0 48px;
  color: var(--muted);
  font-size: 0.9rem;
  display: grid;
  gap: 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
}

.footer-link {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-credit {
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-brand {
  font-family: "Fraunces", "Georgia", serif;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}

.reveal {
  margin-top: 18px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.two-col {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .panel {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .bar-chart {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 720px) {
  .container {
    width: 100%;
    padding-left: 14px;
    padding-right: 14px;
  }

  .page {
    padding-top: 14px;
    padding-bottom: 28px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .nav-quiet {
    flex-wrap: wrap;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .chat-window {
    height: 50vh;
    min-height: 300px;
    padding: 16px;
  }

  .panel {
    padding: 18px;
    max-width: 100%;
    overflow: hidden;
  }

  .bar-chart {
    width: 100%;
    max-width: 100%;
    padding: 10px 6px 6px;
  }

  .chat-bubble {
    max-width: 88%;
    padding: 8px 10px;
    font-size: 14px;
  }

  .chat-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }

  .chat-actions {
    width: 100%;
    justify-content: space-between;
  }

  .attachment-audio {
    width: 100%;
    max-width: 100%;
  }

  /* Mobile-friendly cards */
  .card {
    padding: 18px;
    border-radius: 16px;
  }

  .panel {
    padding: 18px;
  }

  .card-head h2 {
    font-size: 1.1rem;
  }

  /* Mobile-friendly file tags */
  .file-tags {
    flex-wrap: wrap;
    gap: 6px;
  }

  .file-tags .tag {
    padding: 4px 10px;
    font-size: 12px;
  }

  /* Larger tap targets for mobile */
  .load-older-btn {
    padding: 12px 20px;
    font-size: 14px;
  }

  .attachment-convert-btn,
  .attachment-download-link {
    padding: 10px 16px;
    font-size: 14px;
  }

  /* Better media grid on mobile */
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 6px;
  }

  /* Fix participant list on mobile */
  .person {
    padding: 10px 0;
  }

  /* Section spacing */
  .grid {
    gap: 16px;
  }

  .reveal {
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .container {
    width: 100%;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
  }

  .page {
    padding-top: 10px;
    padding-bottom: 32px;
  }

  .site-header {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .brand-text {
    font-size: 0.95rem;
  }

  .btn.small {
    font-size: 0.65rem;
    padding: 4px 8px;
  }

  .hero {
    padding: 16px 0;
  }

  .hero-heading {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .hero-sub {
    font-size: 0.85rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 10px 8px;
  }

  .stat-card .stat-num {
    font-size: 1.3rem;
  }

  .stat-card .stat-label {
    font-size: 0.65rem;
  }

  .card {
    padding: 12px;
    border-radius: 12px;
  }

  .panel {
    padding: 16px;
    max-width: 100%;
    overflow: hidden;
  }

  .card-head {
    margin-bottom: 10px;
  }

  .card-head h2 {
    font-size: 0.95rem;
  }

  .panel-header h3 {
    font-size: 0.9rem;
  }

  .grid.two-col {
    gap: 14px;
  }

  .chat-window {
    height: 50vh;
    min-height: 260px;
    border-radius: 10px;
    padding: 12px;
  }

  .chat-bubble {
    max-width: 85%;
    padding: 6px 8px;
    font-size: 13px;
    border-radius: 10px;
  }

  .message-text {
    font-size: 0.85rem;
    line-height: 1.4;
  }

  .chat-meta {
    font-size: 0.65rem;
    margin-top: 4px;
  }

  .sender-label {
    font-size: 0.7rem;
    margin-bottom: 2px;
  }

  .attachment {
    padding: 8px 10px;
  }

  .attachment-media {
    max-width: 100%;
    border-radius: 6px;
  }

  .attachment-audio {
    width: 100%;
    max-width: 100%;
    height: 32px;
  }

  /* Style audio controls to be more compact on mobile */
  .attachment-audio::-webkit-media-controls-panel {
    height: 32px;
  }

  .attachment-doc {
    padding: 8px;
  }

  .attachment-doc-row {
    gap: 8px;
  }

  .attachment-doc-icon {
    width: 32px;
    height: 32px;
    font-size: 8px;
  }

  .attachment-doc-name {
    font-size: 12px;
    word-break: break-word;
  }

  .attachment-doc-meta {
    font-size: 11px;
  }

  .attachment-caption {
    font-size: 0.7rem;
  }

  .attachment-download-btn {
    width: 30px;
    height: 30px;
  }

  /* Stack convert buttons on small screens */
  .attachment-btn-row {
    flex-direction: column;
    gap: 6px;
  }

  .attachment-btn-row a,
  .attachment-btn-row button {
    margin-left: 0 !important;
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    padding: 8px 12px;
  }

  /* Better dropdown search on mobile */
  .search-results {
    max-height: 250px;
  }

  .search-result-item {
    padding: 10px;
  }

  .search-result-text {
    font-size: 12px;
  }

  /* Smaller panels and sections */
  .panel-header h3 {
    font-size: 0.9rem;
  }

  .bar-chart {
    height: 140px;
    padding: 8px 4px 4px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .bar {
    min-width: 3px;
  }

  /* Upload form mobile optimization */
  .drop-zone {
    padding: 20px 14px;
  }

  .drop-title {
    font-size: 0.9rem;
  }

  .drop-sub {
    font-size: 0.8rem;
  }

  .upload-progress {
    font-size: 0.75rem;
  }

  .progress-shell {
    min-width: 100px;
    height: 5px;
  }

  /* ChatView mobile optimizations */
  #chatView .chat-window {
    padding: 12px 4%;
  }

  #chatView .chat-bubble {
    max-width: 82%;
    padding: 5px 6px 6px 7px;
    font-size: 13px;
    line-height: 17px;
  }

  #chatView .message-text {
    font-size: 0.8rem;
  }

  #chatView .chat-meta {
    font-size: 0.6rem;
  }

  #chatView .sender-label {
    font-size: 0.68rem;
    margin-bottom: 1px;
  }

  #chatView .chat-topbar {
    padding: 8px 10px;
    gap: 8px;
  }

  #chatView .attachment {
    padding: 6px 8px;
  }

  #chatView .attachment-audio {
    height: 45px;
  }

  #chatView .attachment-doc {
    padding: 6px;
  }

  #chatView .attachment-doc-icon {
    width: 28px;
    height: 28px;
    font-size: 7px;
  }

  #chatView .attachment-doc-name {
    font-size: 11px;
  }

  #chatView .attachment-doc-meta {
    font-size: 10px;
  }

  #chatView .date-chip {
    font-size: 0.65rem;
    padding: 4px 10px;
  }

  #chatView .chat-system {
    font-size: 0.7rem;
    padding: 5px 10px;
  }
}

/* Extra small mobile devices */
@media (max-width: 360px) {
  .container {
    padding-left: 8px;
    padding-right: 8px;
  }

  .hero-heading {
    font-size: 1.3rem;
  }

  .stats-grid {
    gap: 6px;
  }

  .stat-card {
    padding: 8px 6px;
  }

  .stat-card .stat-num {
    font-size: 1.2rem;
  }

  .chat-window {
    padding: 10px;
  }

  .chat-bubble {
    max-width: 88%;
    padding: 5px 7px;
    font-size: 12px;
  }

  .message-text {
    font-size: 0.8rem;
  }

  #chatView .chat-bubble {
    max-width: 85%;
    font-size: 12px;
    line-height: 16px;
  }

  .attachment-audio {
    height: 40px;
  }

  .drop-zone {
    padding: 16px 10px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  .reveal,
  .chart-ready .bar,
  .btn {
    transition: none;
  }

  .bar {
    transform: scaleY(1);
  }
}

/* WhatsApp Scope - Applied only to the chat preview area */

#chatView {
  --wa-bg: #efeae2;
  --wa-incoming: #ffffff;
  --wa-outgoing: #d9fdd3;
  --wa-system: #ffeecd;
  --wa-secondary: #667781;
  --wa-accent: #00a884;
  --wa-header: #f0f2f5;
  --wa-border: #e9edef;
  color: #111b21;
}

#chatView .chat-window {
  background-color: var(--wa-bg);
  background-image: url("https://static.whatsapp.net/rsrc.php/v4/yl/r/gi_DckOUM5a.png");
  background-size: contain;
  background-repeat: repeat;
  position: relative;
  border-radius: var(--radius-md);
  padding: 20px 7%;
}

#chatView .chat-window::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(239, 234, 226, 0.4);
  pointer-events: none;
  border-radius: var(--radius-md);
  display: block;
}

#chatView .chat-window * {
  z-index: 1;
}

#chatView .chat-bubble {
  max-width: 65%;
  padding: 6px 7px 8px 9px;
  border-radius: 7.5px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, .13);
  position: relative;
  font-size: 14.2px;
  line-height: 19px;
  margin-bottom: 2px;
  color: #111b21;
}

#chatView .chat-bubble.incoming {
  background: var(--wa-incoming);
  border-top-left-radius: 0;
  align-self: flex-start;
}

#chatView .chat-bubble.outgoing {
  background: var(--wa-outgoing);
  border-top-right-radius: 0;
  align-self: flex-end;
}

/* Tails */
#chatView .chat-bubble.incoming::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  width: 8px;
  height: 13px;
  background: linear-gradient(to top right, transparent 50%, var(--wa-incoming) 50%);
}

#chatView .chat-bubble.outgoing::before {
  content: "";
  position: absolute;
  top: 0;
  right: -8px;
  width: 8px;
  height: 13px;
  background: linear-gradient(to top left, transparent 50%, var(--wa-outgoing) 50%);
}

#chatView .chat-row {
  width: 100%;
  display: flex;
  flex-direction: column;
}

#chatView .chat-row.incoming {
  align-items: flex-start;
}

#chatView .chat-row.outgoing {
  align-items: flex-end;
}

#chatView .sender-label {
  font-size: 12.8px;
  font-weight: 500;
  color: #1f7d8c;
  margin-bottom: 2px;
}

#chatView .chat-meta {
  float: right;
  margin-left: 8px;
  margin-top: 4px;
  margin-bottom: -4px;
  font-size: 11px;
  color: var(--wa-secondary);
  display: flex;
  align-items: center;
  gap: 3px;
}

#chatView .tick-icon {
  display: inline-flex;
  margin-left: 2px;
}

#chatView .edited-label {
  font-size: 10px;
  color: rgba(102, 119, 129, 0.45);
  margin-right: 2px;
}

#chatView .date-chip {
  align-self: center;
  background: var(--wa-system);
  color: var(--wa-secondary);
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 7.5px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, .13);
  margin: 12px 0;
  text-transform: uppercase;
}

#chatView .chat-system {
  align-self: center;
  background: var(--wa-system);
  color: var(--wa-secondary);
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 7.5px;
  margin: 8px 0;
  max-width: 85%;
  text-align: center;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, .13);
}

#chatView .chat-topbar {
  background: #f0f2f5;
  border-bottom: 1px solid var(--line);
}

#chatView .chat-footer {
  padding: 0;
  margin: 0;
  height: 0;
  border: none;
}

#chatView .chat-composer {
  background: #f0f2f5;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-top: 0;
  padding: 10px 16px;
}

#chatView .composer-pill {
  background: #fff;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 8px;
  flex: 1;
}

#chatView:fullscreen {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

#chatView:fullscreen .chat-window {
  height: calc(100vh - 220px);
}

/* System message icons */
.system-icon {
  margin-right: 6px;
  vertical-align: middle;
}

/* Message links - clickable and blue */
.message-link {
  color: #039be5;
  text-decoration: none;
  word-break: break-all;
}

.message-link:hover {
  text-decoration: underline;
}

/* Poll styling - exact WhatsApp style */
.poll-container {
  padding: 4px 0;
}

.poll-question {
  font-size: 14.2px;
  line-height: 19px;
  color: #111b21;
  margin-bottom: 8px;
}

.poll-select-label {
  font-size: 12px;
  color: #667781;
  margin-bottom: 12px;
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.poll-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.poll-option-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.poll-radio {
  color: #667781;
  font-size: 16px;
}

.poll-option-text {
  flex: 1;
  font-size: 14px;
  color: #111b21;
}

.poll-vote-count {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #667781;
  font-size: 13px;
}

.poll-vote-count svg {
  opacity: 0.7;
}

.poll-progress-bar {
  height: 6px;
  background: #e9edef;
  border-radius: 3px;
  margin-left: 26px;
  overflow: hidden;
}

.poll-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00a884, #25d366);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.poll-view-votes {
  margin-top: 12px;
  text-align: center;
  color: #00a884;
  font-size: 14px;
  cursor: pointer;
}

.poll-view-votes:hover {
  text-decoration: underline;
}

/* PDF/Doc attachment styling - WhatsApp style */
.attachment-doc {
  background: #f0f2f5;
  border-radius: 8px;
  padding: 10px;
  max-width: 100%;
  transition: background 0.15s ease;
}

.attachment-doc:hover {
  background: #e4e6e9;
}

.attachment-doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.attachment-doc-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #667781;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.attachment-doc-icon.pdf-icon {
  background: #e74c3c;
  padding: 4px;
}

.attachment-doc-icon.pdf-icon svg {
  width: 100%;
  height: 100%;
}

.attachment-doc-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.attachment-doc-name {
  font-weight: 500;
  font-size: 14px;
  color: #111b21;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.attachment-doc-meta {
  font-size: 12px;
  color: #667781;
  margin-top: 2px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.attachment-download-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #00a884;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.15s ease;
}

.attachment-download-btn:hover {
  background: #008f6e;
  transform: scale(1.05);
}

.highlight {
  background-color: #fef08a;
  color: #111b21;
  border-radius: 2px;
  padding: 0 2px;
}

.highlight.active {
  background-color: #f97316;
  color: #fff;
}

/* Search Container Styles - WhatsApp Style */
.search-container {
  display: none;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  margin-right: 10px;
  border: 1px solid var(--line);
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

.search-container.is-visible {
  display: flex;
  flex-wrap: nowrap;
  /* On mobile, let it grow but not overflow */
  max-width: 100%;
}

@media (max-width: 500px) {
  .search-container.is-visible {
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    z-index: 20;
    margin: 0;
    width: auto;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
}

/* Search Results Dropdown - WhatsApp Style */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
}

.search-results.has-results {
  display: block;
}

.search-result-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: #f5f6f6;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.search-result-sender {
  font-weight: 600;
  font-size: 13px;
  color: #1f7d8c;
}

.search-result-date {
  font-size: 11px;
  color: var(--muted);
}

.search-result-text {
  font-size: 13px;
  color: #667781;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-text .highlight {
  background: #fef08a;
  color: #111;
  padding: 0 2px;
  border-radius: 2px;
}

/* Highlight row when jumping to search result */
.chat-row.highlight-row .chat-bubble {
  animation: pulseHighlight 2s ease-out;
}

@keyframes pulseHighlight {
  0% {
    box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.4);
  }

  100% {
    box-shadow: none;
  }
}

.search-no-results {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.search-input {
  border: none;
  outline: none;
  font-size: 14px;
  width: 140px;
  background: transparent;
  color: var(--ink);
}

.search-input::placeholder {
  color: var(--muted);
}

.search-match-info {
  font-size: 12px;
  color: var(--muted);
  min-width: 40px;
  text-align: center;
  white-space: nowrap;
}

.search-nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  color: var(--muted);
  font-size: 14px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.search-nav-btn:hover {
  background: rgba(46, 106, 130, 0.1);
  color: var(--accent-2);
}

.search-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.search-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.search-close-btn:hover {
  background: rgba(222, 111, 77, 0.1);
  color: var(--accent);
}

/* Sticky Load More Container */
#loadOlderContainer {
  position: sticky;
  top: 10px;
  z-index: 10;
  margin: -10px 0 12px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.load-older-btn {
  pointer-events: auto;
  padding: 8px 20px;
  min-width: 160px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #00a884;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.load-older-btn:hover {
  transform: translateY(-1px);
  background: #f8f9fa;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  color: #008f6e;
}

.load-older-btn:active {
  transform: translateY(0);
}

.load-older-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#chatStatus {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.file-item a {
  color: inherit;
  text-decoration: none;
}

.file-item a:hover {
  text-decoration: underline;
}

/* File type filter tags */
.file-tags .tag {
  transition: all 0.15s ease;
}

.file-tags .tag:hover {
  background: #e4ded7;
}

.file-tags .tag.active {
  background: var(--accent);
  color: #fff;
}

.file-tags .tag.active strong {
  color: #fff;
}

.file-empty {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 14px;
}

/* Media thumbnail grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.media-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #f0f0f0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.media-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumb-video {
  position: relative;
  width: 100%;
  height: 100%;
}

.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  pointer-events: none;
}

/* Dark theme overrides */
body.dark-mode {
  color-scheme: dark;
  --bg: #1c1c1c;
  --surface: #232323;
  --surface-2: #292929;
  --surface-3: #2f2f2f;
  --ink: #f5f5f2;
  --muted: #b1b4ad;
  --accent: #c4ef17;
  --accent-2: #d4ff32;
  --line: #353535;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);

  background: linear-gradient(120deg, #1c1c1c 0%, #171717 60%, #141414 100%);
}

body.dark-mode::before {
  background:
    radial-gradient(circle at 20% 10%, rgba(196, 239, 23, 0.12), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(196, 239, 23, 0.05), transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(196, 239, 23, 0.08), transparent 55%);
}

body.dark-mode .brand-dot {
  box-shadow: 0 0 0 6px rgba(196, 239, 23, 0.18);
}

body.dark-mode .eyebrow {
  color: var(--accent);
}

body.dark-mode .upload-card,
body.dark-mode .panel {
  background: var(--surface);
  box-shadow: var(--shadow);
}

body.dark-mode .badge {
  color: var(--accent);
  background: rgba(196, 239, 23, 0.12);
}

body.dark-mode .drop-zone {
  background: var(--surface-2);
}

body.dark-mode .drop-zone.is-dragover {
  background: #1f2415;
}

body.dark-mode .drop-zone.is-uploading {
  background: #202a17;
  box-shadow: 0 0 0 4px rgba(196, 239, 23, 0.12);
}

body.dark-mode .drop-zone::before {
  background: linear-gradient(90deg, rgba(196, 239, 23, 0.2), rgba(196, 239, 23, 0.3));
}

body.dark-mode .drop-zone.has-file {
  background: #242b1a;
  box-shadow: 0 0 0 3px rgba(196, 239, 23, 0.12);
}

body.dark-mode .drop-zone.is-uploaded {
  background: #2b3518;
  box-shadow: 0 0 0 4px rgba(196, 239, 23, 0.18);
}

body.dark-mode .btn {
  color: #1c1c1c;
}

body.dark-mode .btn.ghost {
  color: var(--accent);
}

body.dark-mode .btn:hover {
  box-shadow: 0 10px 20px rgba(196, 239, 23, 0.18);
}

body.dark-mode .share-tip {
  background: linear-gradient(135deg, rgba(196, 239, 23, 0.08), rgba(196, 239, 23, 0.05));
  border-color: rgba(196, 239, 23, 0.25);
}

body.dark-mode .share-tip summary {
  color: var(--accent);
}

body.dark-mode .share-tip[open] summary {
  border-bottom-color: rgba(196, 239, 23, 0.2);
}

body.dark-mode .share-steps strong {
  color: var(--accent);
}

body.dark-mode .progress-shell {
  background: #2a2a2a;
}

body.dark-mode .progress-fill {
  background: linear-gradient(90deg, #93b40f, var(--accent));
}

body.dark-mode .spinner {
  border: 2px solid rgba(196, 239, 23, 0.2);
  border-top-color: var(--accent);
}

body.dark-mode .privacy-callout {
  background: var(--surface-2);
}

body.dark-mode .stat-card,
body.dark-mode .bar-chart,
body.dark-mode .tag,
body.dark-mode .file-item,
body.dark-mode .timeline-item,
body.dark-mode .attachment {
  background: var(--surface-2);
}

body.dark-mode .bar {
  background: linear-gradient(180deg, var(--accent) 0%, #88aa10 100%);
}

body.dark-mode .bar.alt {
  background: linear-gradient(180deg, #4b4b4b 0%, #2f2f2f 100%);
}

body.dark-mode .progress {
  background: #2a2a2a;
}

body.dark-mode .progress span {
  background: linear-gradient(90deg, var(--accent), #8fb111);
}

body.dark-mode .file-type {
  background: rgba(196, 239, 23, 0.12);
  color: var(--accent);
}

body.dark-mode .status,
body.dark-mode .upload-progress {
  color: #fff;
}

body.dark-mode .file-tags .tag:hover {
  background: #2a2a2a;
}

body.dark-mode .tag.active {
  color: #1c1c1c;
}

body.dark-mode .tag.active strong {
  color: #1c1c1c;
}

body.dark-mode .media-thumb {
  background: #222;
}

body.dark-mode .privacy-link,
body.dark-mode .footer-link {
  color: var(--accent);
}

/* WhatsApp preview - dark theme (scoped) */
body.dark-mode #chatView {
  --wa-bg: #0b141a;
  --wa-incoming: #202c33;
  --wa-outgoing: #005c4b;
  --wa-system: #1f2c33;
  --wa-secondary: #8696a0;
  --wa-accent: #c4ef17;
  --wa-header: #202c33;
  --wa-border: #37404a;
  color: #e9edef;
}

body.dark-mode #chatView .chat-window {
  background-color: var(--wa-bg);
  background-image: linear-gradient(rgba(11, 20, 26, 0.95), rgba(11, 20, 26, 0.95)), url("https://static.whatsapp.net/rsrc.php/v4/yl/r/gi_DckOUM5a.png");
  background-size: 700px;
  background-repeat: repeat;
}

body.dark-mode #chatView .chat-window::before {
  display: none;
}

body.dark-mode #chatView .chat-bubble {
  background: var(--wa-incoming);
  color: #e9edef;
  box-shadow: none;
}

body.dark-mode #chatView .chat-bubble.outgoing {
  background: var(--wa-outgoing);
}

body.dark-mode #chatView .message-text {
  color: #e9edef;
}

body.dark-mode #chatView .sender-label {
  color: var(--wa-accent);
}

body.dark-mode #chatView .chat-meta {
  color: rgba(233, 237, 239, 0.6);
}

body.dark-mode #chatView .date-chip,
body.dark-mode #chatView .chat-system {
  background: var(--wa-system);
  color: #d6dde1;
}

body.dark-mode #chatView .chat-topbar {
  background: #111b21;
  border-bottom-color: #2a2a2a;
  color: #e9edef;
}

body.dark-mode #chatView .chat-title {
  color: #e9edef;
}

body.dark-mode #chatView .chat-sub {
  color: #8696a0;
}

body.dark-mode #chatView .chat-composer {
  background: #111b21;
  border-top-color: #2a2a2a;
}

body.dark-mode #chatView .chat-controls label {
  color: #8696a0;
}

body.dark-mode #chatView .chat-controls select {
  background: #2a3942;
  color: #e9edef;
  border-color: #37404a;
}

body.dark-mode #chatView .composer-pill {
  background: #1f2c33;
  color: #b3bec4;
}

body.dark-mode #chatView .attachment {
  background: rgba(32, 44, 51, 0.9);
  border-color: #2a2a2a;
}

body.dark-mode #chatView .attachment-caption {
  color: #b3bec4;
}

body.dark-mode #chatView .attachment-doc {
  background: #1f2c33;
}

body.dark-mode #chatView .attachment-doc:hover {
  background: #28343b;
}

body.dark-mode #chatView .attachment-doc-name {
  color: #e8ecef;
}

body.dark-mode .load-older-btn {
  background: #202c33;
  color: #00a884;
  border-color: #37404a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .load-older-btn:hover {
  background: #2a3942;
  color: #00c298;
}

body.dark-mode #chatView .attachment-doc-meta {
  color: #b3bec4;
}

body.dark-mode .attachment-convert-btn,
body.dark-mode .attachment-download-link {
  background: #2a3942;
  color: #e9edef;
  border-color: #37404a;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

body.dark-mode .attachment-convert-btn:hover,
body.dark-mode .attachment-download-link:hover {
  background: #37404a;
  border-color: #00a884;
}