:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #667085;
  --soft: #eef6fd;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --line: #dfe7f0;
  --blue: #0877ff;
  --blue-2: #42b9ff;
  --violet: #7b61ff;
  --green: #22c55e;
  --danger: #ef4444;
  --shadow: 0 24px 70px rgba(44, 72, 105, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  overflow: auto;
  background:
    radial-gradient(circle at 20% 10%, rgba(82, 182, 255, 0.22), transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(255, 113, 170, 0.16), transparent 24%),
    linear-gradient(135deg, #f5fbff 0%, #f8fbff 48%, #fff7fb 100%);
  overflow: hidden;
}

body::before,
body::after {
  position: fixed;
  inset: auto 0 -18vh;
  z-index: -2;
  height: 135vh;
  pointer-events: none;
  content: "";
  background-image:
    radial-gradient(circle, rgba(255, 190, 98, 0.58) 0 1.8px, transparent 3px),
    radial-gradient(circle, rgba(255, 126, 72, 0.34) 0 1.2px, transparent 3px),
    radial-gradient(circle, rgba(255, 255, 255, 0.7) 0 1px, transparent 2.5px);
  background-position:
    7% 94%,
    19% 99%,
    37% 91%,
    58% 98%,
    81% 94%,
    94% 99%;
  background-size:
    260px 260px,
    360px 360px,
    480px 480px;
  opacity: 0.38;
  animation: sparks-rise 30s linear infinite;
}

body::after {
  opacity: 0.22;
  animation-duration: 44s;
  animation-delay: -18s;
}

@keyframes sparks-rise {
  from {
    transform: translateY(18vh);
  }
  to {
    transform: translateY(-90vh);
  }
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.app-shell {
  width: 100vw;
  height: 100vh;
  padding: 0;
}

.auth-view {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  align-items: center;
  gap: 28px;
}

.brand-panel h1 {
  max-width: 760px;
  margin: 0;
  color: #0f172a;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-weight: 900;
  text-transform: uppercase;
}

.intro {
  max-width: 620px;
  margin: 24px 0 0;
  color: #475569;
  font-size: 1.08rem;
  line-height: 1.6;
}

.liquid-panel,
.auth-panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.68));
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -24px 50px rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(28px) saturate(1.28);
  -webkit-backdrop-filter: blur(28px) saturate(1.28);
}

.auth-panel {
  border-radius: 22px;
  padding: 24px;
}

.tab-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 22px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(226, 239, 250, 0.76);
}

.tab,
.primary-button,
.secondary-button,
.danger-button,
.send-button,
.download-button,
.new-button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  color: var(--ink);
  font-weight: 800;
  background: rgba(255, 255, 255, 0.72);
  transition:
    transform 420ms cubic-bezier(0.18, 0.9, 0.2, 1.15),
    border-radius 420ms cubic-bezier(0.18, 0.9, 0.2, 1.15),
    box-shadow 220ms ease,
    background 220ms ease;
}

.tab.active,
.primary-button,
.send-button,
.new-button {
  color: #fff;
  background: linear-gradient(135deg, var(--blue-2), var(--blue));
  box-shadow: 0 12px 28px rgba(8, 119, 255, 0.22);
}

button:hover {
  transform: translateY(-1px);
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.auth-form,
.search-box {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfd9e6;
  border-radius: 10px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  outline: none;
}

input::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus {
  border-color: rgba(8, 119, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(8, 119, 255, 0.1);
}

.message {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--danger);
  font-weight: 800;
}

.chat-view {
  width: 100%;
  min-width: 1180px;
  height: 100vh;
  display: grid;
  grid-template-columns: 258px 346px minmax(0, 1fr);
  gap: 4px;
  padding: 0;
}

.nav-rail {
  height: 100vh;
  padding: 41px 22px 60px;
  border-radius: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 28px;
  background: rgba(237, 247, 255, 0.76);
  box-shadow: inset -1px 0 0 rgba(192, 213, 232, 0.42);
}

.profile-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 0 10px;
}

.profile-card strong {
  display: block;
  overflow: hidden;
  font-size: 1.02rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar,
.mini-avatar {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.7), transparent 24%),
    linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 14px 32px rgba(8, 119, 255, 0.18);
}

.avatar {
  width: 54px;
  height: 54px;
  font-size: 1.3rem;
}

.avatar::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  width: 12px;
  height: 12px;
  border: 3px solid #eef8ff;
  border-radius: 50%;
  content: "";
  background: var(--green);
}

.mini-avatar {
  width: 46px;
  height: 46px;
}

.muted {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.new-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 20px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  text-align: left;
}

.new-button span,
.new-button small {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 500;
  text-align: center;
}

.rail-menu,
.rail-bottom {
  display: grid;
  gap: 12px;
}

.rail-bottom {
  align-self: end;
  padding-top: 30px;
  border-top: 1px solid #d9e4ef;
}

.rail-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  background: transparent;
  text-align: left;
}

.rail-link span {
  width: 26px;
  color: #475569;
  font-size: 1.35rem;
  text-align: center;
}

.rail-link.active {
  color: var(--blue);
  background: rgba(8, 119, 255, 0.1);
}

.rail-link.active::before {
  position: absolute;
  left: 0;
  width: 2px;
  height: 56px;
  border-radius: 999px;
  content: "";
  background: var(--blue);
}

.rail-link.as-button {
  width: 100%;
  min-height: 50px;
  box-shadow: none;
}

.list-panel {
  height: calc(100vh - 14px);
  margin: 0;
  align-self: start;
  border-radius: 16px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 28px;
  padding: 36px 24px;
  background: rgba(255, 255, 255, 0.88);
}

.list-header,
.conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.list-header h2,
.conversation-header h2 {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 1.45rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plain-icon,
.round-tool {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: #475569;
  font-size: 1.34rem;
  background: transparent;
}

.danger-icon {
  color: var(--danger);
}

.danger-icon:hover:not(:disabled) {
  color: #fff;
  background: linear-gradient(135deg, #fb7185, #ef4444);
}

.round-tool {
  background: rgba(255, 255, 255, 0.8);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.search-row .secondary-button {
  display: none;
}

#search-input {
  min-height: 48px;
  padding-left: 46px;
  background-color: rgba(255, 255, 255, 0.75);
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.8 18.1a7.3 7.3 0 1 1 0-14.6 7.3 7.3 0 0 1 0 14.6Zm5.2-2.1 4.2 4.2' stroke='%2364758b' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 17px 50%;
}

.section-title {
  margin-bottom: 18px;
}

.section-title h3 {
  margin: 0;
  color: #334155;
  font-size: 0.92rem;
}

.item-list {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  max-height: none;
}

.list-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 74px;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.list-item.active,
.list-item:hover {
  background: rgba(226, 241, 255, 0.68);
}

.chat-row-main,
.chat-row-top,
.chat-row-bottom {
  min-width: 0;
}

.chat-row-top,
.chat-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.list-item strong,
.list-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item time {
  color: #475569;
  font-size: 0.78rem;
}

.list-item small {
  color: var(--muted);
  font-size: 0.84rem;
}

.list-item em {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.list-empty,
.no-more-chats {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.conversation-panel {
  position: relative;
  height: calc(100vh - 30px);
  margin: 15px 15px 15px 0;
  border-radius: 16px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
}

.conversation-header {
  min-height: 88px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.conversation-header > div:first-child {
  min-width: 0;
}

.conversation-header p {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

#chat-context::after {
  content: "";
}

.call-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 18px;
}

.call-tool.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 14px 34px rgba(8, 119, 255, 0.22);
}

.call-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  color: var(--ink);
  background: rgba(8, 119, 255, 0.08);
  border-bottom: 1px solid var(--line);
}

.call-banner span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.incoming-call {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  color: var(--ink);
  background: rgba(8, 119, 255, 0.1);
  border-bottom: 1px solid var(--line);
}

.incoming-call span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.incoming-actions {
  display: flex;
  gap: 10px;
}

.call-modal {
  position: absolute;
  top: 98px;
  right: 22px;
  z-index: 9;
  display: grid;
  gap: 14px;
  width: min(420px, calc(100% - 44px));
  border-radius: 22px;
  padding: 18px;
  color: var(--ink);
}

.call-modal.hidden {
  display: none;
}

.call-modal-status {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.call-modal-status span,
.range-row small {
  color: var(--muted);
}

.range-row {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.range-row span,
.range-row strong,
.range-row small {
  display: block;
}

.range-row input[type="range"] {
  width: 100%;
  min-height: 0;
  accent-color: var(--blue);
}

.compact-setting {
  min-height: 72px;
}

.call-modal-actions {
  display: grid;
  grid-template-columns: 1fr 104px 104px;
  gap: 10px;
}

.voice-meter {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 28px;
}

.voice-meter span {
  width: 6px;
  border-radius: 999px;
  background: var(--blue);
  animation: pulse-bar 900ms infinite ease-in-out;
}

.voice-meter span:nth-child(1) {
  height: 10px;
}

.voice-meter span:nth-child(2) {
  height: 24px;
  animation-delay: 120ms;
}

.voice-meter span:nth-child(3) {
  height: 16px;
  animation-delay: 240ms;
}

.voice-meter span:nth-child(4) {
  height: 22px;
  animation-delay: 360ms;
}

@keyframes pulse-bar {
  50% {
    transform: scaleY(0.45);
    opacity: 0.65;
  }
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 24px 104px;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  max-width: 430px;
  margin: auto;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.65rem;
}

.empty-state p {
  margin: 0;
  font-size: 1rem;
}

.empty-icon {
  position: relative;
  width: 118px;
  height: 86px;
}

.empty-icon span {
  position: absolute;
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.86), transparent 28%),
    linear-gradient(135deg, var(--blue-2), var(--violet));
  box-shadow: 0 18px 44px rgba(8, 119, 255, 0.2);
}

.empty-icon span:first-child {
  inset: 24px 36px 0 0;
}

.empty-icon span:last-child {
  inset: 0 0 30px 46px;
  opacity: 0.34;
}

.bubble {
  position: relative;
  max-width: min(70%, 620px);
  border-radius: 18px 18px 18px 6px;
  padding: 10px 38px 10px 13px;
  color: var(--ink);
  line-height: 1.42;
  background: #fff;
  box-shadow: 0 10px 24px rgba(38, 73, 111, 0.08);
}

.bubble.own {
  align-self: flex-end;
  border-radius: 18px 18px 6px 18px;
  background: #dff3ff;
}

.bubble strong {
  display: block;
  margin-bottom: 3px;
  color: var(--blue);
  font-size: 0.76rem;
}

.bubble p {
  margin: 0;
}

.message-delete-button {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-height: 24px;
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: 50%;
  color: #ef4444;
  background: rgba(255, 255, 255, 0.72);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

.bubble:hover .message-delete-button,
.message-delete-button:focus-visible {
  opacity: 1;
  transform: scale(1);
}

.message-delete-button:hover {
  color: #fff;
  background: #ef4444;
}

.delete-timer {
  display: block;
  margin-top: 7px;
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 800;
}

.message-form {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: grid;
  gap: 8px;
  padding: 20px 24px 22px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -16px 40px rgba(44, 72, 105, 0.08);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.composer {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 118px;
  align-items: center;
  gap: 12px;
}

.upload-button {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid #d6e0ea;
  border-radius: 10px;
  color: #475569;
  background: rgba(255, 255, 255, 0.86);
  font-size: 1.35rem;
}

.send-button {
  min-height: 52px;
  border-radius: 10px;
}

.file-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 64px;
}

.message-form > .file-name {
  display: none;
}

.message-form > .file-name.visible {
  display: block;
}

.attachment {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.attachment img,
.attachment video {
  display: block;
  max-width: min(100%, 390px);
  max-height: 300px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.08);
}

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

.download-button {
  justify-self: start;
  min-height: 36px;
  padding: 0 14px;
}

.expired-attachment {
  border: 1px dashed rgba(100, 116, 139, 0.38);
  border-radius: 16px;
  padding: 10px;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.upload-modal {
  width: min(560px, 100%);
  border-radius: 22px;
  padding: 22px;
}

.delete-modal,
.clear-chats-modal,
.search-modal,
.settings-modal {
  width: min(460px, 100%);
  border-radius: 22px;
  padding: 22px;
}

.clear-chats-modal,
.search-modal {
  width: min(620px, 100%);
}

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

.modal-header {
  margin-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
}

.drop-zone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 230px;
  border: 1.5px dashed rgba(8, 119, 255, 0.32);
  border-radius: 26px;
  padding: 24px;
  color: var(--ink);
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(65, 185, 255, 0.2), transparent 36%),
    rgba(255, 255, 255, 0.62);
}

.drop-zone.dragging {
  border-color: var(--blue);
  background:
    radial-gradient(circle at 50% 0%, rgba(65, 185, 255, 0.32), transparent 36%),
    rgba(255, 255, 255, 0.8);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  color: #fff;
  font-size: 2rem;
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 255, 255, 0.75), transparent 30%),
    linear-gradient(135deg, var(--blue-2), var(--violet));
}

.drop-zone small {
  color: var(--muted);
}

.upload-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.delete-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.clear-range {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  color: var(--ink);
  font-weight: 800;
}

.clear-list-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.clear-chat-list {
  display: grid;
  gap: 10px;
  max-height: min(42vh, 420px);
  overflow-y: auto;
  padding-right: 4px;
}

.clear-chat-choice {
  display: grid;
  grid-template-columns: 22px 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.clear-chat-choice input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--danger);
}

.clear-chat-choice span:last-child {
  min-width: 0;
}

.clear-chat-choice strong,
.clear-chat-choice small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clear-chat-choice small {
  margin-top: 3px;
  color: var(--muted);
}

.modal-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.split-actions {
  justify-content: flex-end;
}

.danger-button {
  min-height: 44px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 12px;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(135deg, #fb7185, #ef4444);
  box-shadow: 0 14px 30px rgba(239, 68, 68, 0.18);
}

.ghost-danger {
  color: #ef4444;
  background: rgba(254, 226, 226, 0.76);
  box-shadow: none;
}

.modal-actions .file-name {
  display: block;
  padding-left: 0;
}

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

.modal-search-input {
  width: 100%;
  min-height: 50px;
  margin-bottom: 14px;
  border-radius: 14px;
}

.message-search-results {
  display: grid;
  gap: 10px;
  max-height: min(52vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}

.message-search-result {
  display: grid;
  gap: 7px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.7);
}

.message-search-result:hover {
  border-color: rgba(8, 119, 255, 0.26);
  background: rgba(235, 247, 255, 0.86);
}

.message-search-result span,
.message-search-result strong,
.message-search-result small {
  display: block;
}

.message-search-result small {
  margin-top: 3px;
  color: var(--muted);
}

.message-search-result p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 86px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  padding: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row small {
  margin-top: 4px;
  color: var(--muted);
}

.setting-row input {
  width: 48px;
  min-width: 48px;
  height: 28px;
  min-height: 28px;
  accent-color: #00ff8a;
}

body.opsec-mode {
  --ink: #d6ffe5;
  --muted: #74b88d;
  --line: rgba(0, 255, 136, 0.18);
  --blue: #00ff8a;
  --blue-2: #3cffb3;
  --violet: #00d46a;
  --green: #00ff8a;
  --danger: #ff3158;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(0, 255, 136, 0.14), transparent 24%),
    radial-gradient(circle at 80% 6%, rgba(0, 190, 255, 0.08), transparent 20%),
    linear-gradient(135deg, #020604 0%, #06130c 52%, #010302 100%);
}

body.opsec-mode::before {
  inset: 0;
  height: auto;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(0, 255, 136, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 136, 0.04) 1px, transparent 1px);
  background-size: 100% 4px, 52px 52px;
  animation: opsec-scan 7s linear infinite;
}

body.opsec-mode::after {
  inset: 0;
  height: auto;
  opacity: 0.18;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 28px,
      rgba(0, 255, 136, 0.08) 29px,
      transparent 31px
    );
  animation: opsec-drift 18s linear infinite;
}

@keyframes opsec-scan {
  from {
    transform: translateY(-20px);
  }
  to {
    transform: translateY(20px);
  }
}

@keyframes opsec-drift {
  from {
    transform: translateX(-80px);
  }
  to {
    transform: translateX(80px);
  }
}

body.opsec-mode .liquid-panel,
body.opsec-mode .auth-panel,
body.opsec-mode .nav-rail,
body.opsec-mode .list-panel,
body.opsec-mode .conversation-panel,
body.opsec-mode .call-modal,
body.opsec-mode .upload-modal,
body.opsec-mode .delete-modal,
body.opsec-mode .clear-chats-modal,
body.opsec-mode .search-modal,
body.opsec-mode .settings-modal {
  border-color: rgba(0, 255, 136, 0.22);
  background:
    linear-gradient(135deg, rgba(0, 255, 136, 0.08), rgba(0, 20, 10, 0.82)),
    rgba(0, 10, 5, 0.86);
  box-shadow:
    0 0 0 1px rgba(0, 255, 136, 0.07),
    0 24px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(0, 255, 136, 0.24);
}

body.opsec-mode .nav-rail {
  background: rgba(0, 12, 6, 0.9);
  box-shadow:
    inset -1px 0 0 rgba(0, 255, 136, 0.16),
    0 0 60px rgba(0, 255, 136, 0.08);
}

body.opsec-mode .list-header h2,
body.opsec-mode .conversation-header h2,
body.opsec-mode .brand-panel h1,
body.opsec-mode .section-title h3,
body.opsec-mode .profile-card strong,
body.opsec-mode .rail-link,
body.opsec-mode .empty-state h3 {
  color: var(--ink);
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.24);
}

body.opsec-mode .conversation-header,
body.opsec-mode .message-form,
body.opsec-mode .call-banner,
body.opsec-mode .incoming-call,
body.opsec-mode .call-modal-status,
body.opsec-mode .range-row,
body.opsec-mode .message-search-result,
body.opsec-mode .clear-chat-choice {
  border-color: rgba(0, 255, 136, 0.16);
  background: rgba(0, 18, 8, 0.86);
}

body.opsec-mode input,
body.opsec-mode select,
body.opsec-mode .upload-button,
body.opsec-mode .round-tool,
body.opsec-mode .plain-icon,
body.opsec-mode .setting-row,
body.opsec-mode .drop-zone,
body.opsec-mode .modal-search-input {
  color: var(--ink);
  border-color: rgba(0, 255, 136, 0.24);
  background: rgba(0, 24, 10, 0.72);
  box-shadow: inset 0 0 18px rgba(0, 255, 136, 0.04);
}

body.opsec-mode input::placeholder {
  color: rgba(116, 184, 141, 0.82);
}

body.opsec-mode .tab.active,
body.opsec-mode .primary-button,
body.opsec-mode .send-button,
body.opsec-mode .new-button,
body.opsec-mode .secondary-button:hover {
  color: #001a0c;
  background: linear-gradient(135deg, #00ff8a, #00c767);
  box-shadow: 0 0 28px rgba(0, 255, 136, 0.24);
}

body.opsec-mode .rail-link.active,
body.opsec-mode .rail-link:hover,
body.opsec-mode .list-item.active,
body.opsec-mode .list-item:hover {
  color: #00ff8a;
  background: rgba(0, 255, 136, 0.1);
}

body.opsec-mode .rail-link span,
body.opsec-mode .plain-icon,
body.opsec-mode .round-tool {
  color: #00ff8a;
}

body.opsec-mode .mini-avatar,
body.opsec-mode .avatar,
body.opsec-mode .empty-icon span,
body.opsec-mode .drop-icon {
  color: #001a0c;
  background: linear-gradient(135deg, #00ff8a, #00a85a);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.28);
}

body.opsec-mode .avatar::after,
body.opsec-mode .online-dot {
  background: #00ff8a;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.9);
}

body.opsec-mode .bubble,
body.opsec-mode .bubble.own {
  color: var(--ink);
  border: 1px solid rgba(0, 255, 136, 0.18);
  background: rgba(0, 24, 10, 0.72);
  box-shadow: 0 0 26px rgba(0, 255, 136, 0.08);
}

body.opsec-mode .bubble strong,
body.opsec-mode .eyebrow {
  color: #00ff8a;
}

body.opsec-mode .message-delete-button {
  color: #ff3158;
  border-color: rgba(255, 49, 88, 0.28);
  background: rgba(0, 18, 8, 0.92);
}

body.opsec-mode .message-delete-button:hover,
body.opsec-mode .danger-button {
  color: #fff;
  background: linear-gradient(135deg, #ff3158, #9f1239);
  box-shadow: 0 0 24px rgba(255, 49, 88, 0.2);
}

body.opsec-mode .modal-backdrop {
  background: rgba(0, 0, 0, 0.62);
}

body.cozy-mode {
  --ink: #ffe9cf;
  --muted: #d1a47a;
  --soft: #2b160d;
  --panel: rgba(43, 24, 14, 0.66);
  --panel-strong: rgba(54, 30, 17, 0.82);
  --line: rgba(255, 188, 112, 0.18);
  --blue: #f59e0b;
  --blue-2: #fb923c;
  --violet: #c2410c;
  --green: #a3e635;
  --danger: #f87171;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 112%, rgba(255, 112, 39, 0.32), transparent 30%),
    radial-gradient(circle at 22% 15%, rgba(245, 158, 11, 0.14), transparent 28%),
    radial-gradient(circle at 86% 5%, rgba(124, 45, 18, 0.22), transparent 25%),
    linear-gradient(135deg, #130b08 0%, #24130c 48%, #351a0d 100%);
}

body.cozy-mode::before,
body.cozy-mode::after {
  z-index: 0;
  opacity: 0.26;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(circle, rgba(255, 221, 151, 0.62) 0 1.1px, transparent 2.6px),
    radial-gradient(circle, rgba(251, 146, 60, 0.36) 0 1px, transparent 3px),
    radial-gradient(circle, rgba(255, 245, 220, 0.38) 0 0.8px, transparent 2.2px);
  animation-duration: 62s;
}

body.cozy-mode::after {
  opacity: 0.18;
  animation-duration: 86s;
}

body.cozy-mode .auth-view,
body.cozy-mode .chat-view {
  position: relative;
  z-index: 1;
}

body.cozy-mode .liquid-panel,
body.cozy-mode .auth-panel,
body.cozy-mode .nav-rail,
body.cozy-mode .list-panel,
body.cozy-mode .conversation-panel,
body.cozy-mode .call-modal,
body.cozy-mode .upload-modal,
body.cozy-mode .delete-modal,
body.cozy-mode .clear-chats-modal,
body.cozy-mode .search-modal,
body.cozy-mode .settings-modal {
  border-color: rgba(255, 214, 158, 0.22);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 214, 158, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(82, 45, 24, 0.72), rgba(34, 18, 12, 0.7)),
    rgba(31, 18, 12, 0.72);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 224, 178, 0.22);
}

body.cozy-mode .conversation-header,
body.cozy-mode .message-form,
body.cozy-mode .call-banner,
body.cozy-mode .incoming-call,
body.cozy-mode .call-modal-status,
body.cozy-mode .range-row,
body.cozy-mode .setting-row,
body.cozy-mode .message-search-result,
body.cozy-mode .clear-chat-choice {
  border-color: rgba(255, 188, 112, 0.16);
  background: rgba(35, 20, 13, 0.64);
}

body.cozy-mode input,
body.cozy-mode select,
body.cozy-mode .upload-button,
body.cozy-mode .round-tool,
body.cozy-mode .plain-icon,
body.cozy-mode .drop-zone {
  color: var(--ink);
  border-color: rgba(255, 188, 112, 0.2);
  background: rgba(45, 25, 15, 0.64);
}

body.cozy-mode .primary-button,
body.cozy-mode .send-button,
body.cozy-mode .new-button,
body.cozy-mode .tab.active,
body.cozy-mode .secondary-button:hover {
  color: #1b0d07;
  background: linear-gradient(135deg, #f59e0b, #fb923c);
  box-shadow: 0 18px 38px rgba(245, 158, 11, 0.18);
}

body.cozy-mode .rail-link.active,
body.cozy-mode .rail-link:hover,
body.cozy-mode .list-item.active,
body.cozy-mode .list-item:hover,
body.cozy-mode .message-search-result:hover {
  color: #fff7ed;
  background: rgba(92, 48, 22, 0.62);
}

body.cozy-mode .mini-avatar,
body.cozy-mode .avatar,
body.cozy-mode .empty-icon span,
body.cozy-mode .drop-icon {
  color: #1b0d07;
  background: linear-gradient(135deg, #f59e0b, #fb923c);
  box-shadow: 0 18px 42px rgba(245, 158, 11, 0.18);
}

body.cozy-mode .bubble {
  border: 1px solid rgba(255, 188, 112, 0.14);
  background: rgba(42, 24, 15, 0.76);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

body.cozy-mode .bubble.own {
  background: rgba(100, 52, 22, 0.7);
}

@media (max-width: 760px) {
  .auth-view,
  .auth-view {
    grid-template-columns: 1fr;
  }

  .composer,
  .upload-settings,
  .delete-settings {
    grid-template-columns: 1fr;
  }

  .upload-button,
  .send-button {
    width: 100%;
  }

  .call-modal {
    top: 86px;
    right: 12px;
    width: calc(100% - 24px);
  }

  .call-modal-actions {
    grid-template-columns: 1fr;
  }

  .file-name {
    padding-left: 0;
  }
}
