:root {
  --font-family: 'Inter', 'Microsoft YaHei', 'PingFang SC', Helvetica, Arial, sans-serif;
  --bg: #f7f8fb;
  --fg: #0f172a;
  --muted: #6b7280;
  --card: #ffffff;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --danger: #dc2626;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] {
  --bg: #0b1120;
  --fg: #e2e8f0;
  --muted: #94a3b8;
  --card: #111827;
  --border: #1f2937;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.12);
  --danger: #f87171;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

*::-webkit-scrollbar {
  width: 4px;
}

*::-webkit-scrollbar-thumb {
  background-color: var(--accent);
  border-radius: 4px; 
}

*::-webkit-scrollbar-track {
  background-color: unset;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-family);
  color: var(--fg);
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 45%),
    radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.08), transparent 50%),
    var(--bg);
  overflow-y: auto;
}

img,
canvas {
  max-width: 100%;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0px 24px;
  gap: 24px;
}

@media (max-width: 768px) {

}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.fade-card {
  animation: fadeUp 0.45s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.card {
  background: var(--card);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-mark {
  width: 32px;
  height: 32px;
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
}

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

.header-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.theme-toggle {
  position: relative;
}

.language-toggle {
  position: relative;
}

.language-toggle .icon-btn {
  width: auto;
  padding: 0 14px;
  gap: 8px;
}

.theme-toggle:hover ,#roomQuickBtn:hover{
  background: var(--accent-soft);
  border-radius: 16px;
}

.header-controls .fa-solid,
.header-controls .fa-regular {
  font-size: 18px;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 2px);
  right: -2px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  padding: 6px;
  display: none;
  flex-direction: column;
  min-width: 38px;
  z-index: 20;
}

.theme-toggle.open .theme-menu {
  display: flex;
}

.theme-menu button {
  border: none;
  background: transparent;
  color: var(--fg);
  text-align: left;
  padding: 8px;
  margin: 2px 0;
  border-radius: 50px;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-menu button:hover,
.theme-menu button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.icon-btn {
  border: none;
  background: unset;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  cursor: pointer;
}

.icon-btn.small {
  width: 32px;
  height: 32px;
  box-shadow: none;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.language-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: -24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  padding: 6px;
  display: none;
  flex-direction: column;
  z-index: 20;
}

.language-toggle.open .language-menu {
  display: flex;
}

.language-menu button {
  border: none;
  background: transparent;
  color: var(--fg);
  text-align: left;
  padding: 8px 12px;
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 1px 0;
}

.language-menu button:hover,
.language-menu button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: min(1200px, 100%);
  align-self: center;
  padding: 0 24px;
  box-sizing: border-box;
}

.panel {
  background: transparent;
}

#landing {
  gap: 2em;
}

.hero {
  display: flex;
  flex-direction: column;
}

.hero-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.hero-text {
  padding: 32px;
  border-radius: 32px;
  background: linear-gradient(135deg, rgb(0 80 255), rgb(0 0 0 / 20%));
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero-text::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.hero-text h1 {
  margin: 12px 0 16px;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
}

.hero-text .muted {
  color: rgba(255, 255, 255, 0.85);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.highlight {
  background: rgba(109, 109, 109, 0.1);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  backdrop-filter: blur(6px);
  transform: translateY(-0.332759px);
}

.highlight:hover {
  background: rgba(109, 109, 109, 0.15);
  transform: translateY(-0.332759px);
}

.highlight i {
  font-size: 20px;
}

.hero-visual {
  padding: 0;
}

.hero-panel {
  padding: 28px;
  border-radius: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

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

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
}

.chat-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bubble {
  background: var(--accent-soft);
  border-radius: 16px;
  padding: 12px 16px;
  animation: bubbleIn 0.4s ease;
}

.bubble.alt {
  background: rgba(15, 23, 42, 0.05);
}

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

.progress-preview {
  background: var(--accent-soft);
  border-radius: 16px;
  padding: 14px 16px;
}

.progress-line {
  margin: 8px 0;
  background: var(--border);
  border-radius: 999px;
  height: 6px;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.hero-metrics div {
  text-align: center;
  padding: 12px 0;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 18px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.08);
  color: var(--fg);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
      box-shadow: 0 12px 20px rgba(37, 99, 235, 0.25);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.ripple {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.ripple-effect {
  position: absolute;
  border-radius: 999px;
  transform: scale(0);
  opacity: 0.35;
  background: currentColor;
  pointer-events: none;
  animation: ripplePulse 500ms ease-out forwards;
  mix-blend-mode: multiply;
}

@keyframes ripplePulse {
  to {
    transform: scale(3.2);
    opacity: 0;
  }
}

.view {
  min-height: 420px;
}

.message-view {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.massageButton {
  display: flex;
  gap: 12px;
  justify-content: space-evenly;
}

[data-theme='dark'] .message-body {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(15, 23, 42, 0.9));
  border-color: rgba(148, 163, 184, 0.2);
}

.message-body {
  position: relative;
  flex: 1;
  border-radius: 14px;
  padding: 24px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 550px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.home-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
}

.home-room-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.home-room-meta strong {
  font-size: 20px;
}

.home-stats {
  display: flex;
  gap: 12px;
}

.home-stats > div {
  flex: 1;
  background: var(--accent-soft);
  border-radius: 16px;
  padding: 12px;
}

.home-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 16px 0;
}

.message-list {
  flex: 1;
  position: relative;
  z-index: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 12px;
  max-height: 500px;
}

.message-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.message-empty.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.message-card {
  align-self: flex-start;
  max-width: min(85%, 520px);
  min-width: 388px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--card-bg, var(--accent-soft));
  color: var(--card-fg, var(--fg));
  cursor: pointer;
  animation: messagePop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.message-card.own {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
}

.message-card .message-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--card-muted, var(--muted));
  gap: 8px;
}

.message-card.own .message-head {
  color: rgba(255, 255, 255, 0.85);
}

.message-card .message-text {
  margin: 0;
  word-break: break-word;
}

.message-card .muted {
  font-size: 12px;
  color: var(--card-muted, var(--muted));
}

.message-card.own .muted {
  color: rgba(255, 255, 255, 0.8);
}

@keyframes messagePop {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  60% {
    opacity: 1;
    transform: translateY(-2px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message-form {
  gap: 12px;
  align-items: flex-end;
}

.message-form.docked {
  margin-top: auto;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  transition: border 0.2s ease, background 0.2s ease;
}

.message-form:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  cursor: pointer;
}

[data-theme='dark'] .message-form.docked {
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transition: border 0.2s ease, background 0.2s ease;
}

.message-form textarea {
  border-radius: 14px;
  border-color: rgb(226 232 240 / .7);
  padding: 12px 16px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  min-height: 102px !important;
  overflow-y: auto;
  box-sizing: border-box;
  line-height: 1.4;
  width: 100%;
  margin-bottom: 10px;
  resize: vertical;
}

.message-form textarea:focus-visible {
  outline: none;
}

.message-form.docked button {
  border-radius: 999px;
  min-width: 110px;
  align-self: flex-end;
}

.message-clear-btn {
  min-width: auto;
  padding-inline: 16px;
  color: white;
  background: var(--danger);
}

.message-clear-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  margin-bottom: 16px;
  transition: border 0.2s ease, background 0.2s ease;
  background: var(--bg);
}

.drop-zone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  cursor: pointer;
}

.drop-zone input {
  display: none;
}

.drop-zone .fa-cloud-upload-alt{
  font-size: 48px;
  color: #4a6cf7;
  margin-bottom: 12px;
}

.drop-zone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 450px;
  overflow: auto;
}

.file-list .muted {
  text-align: center;
}

.file-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
}

.file-card.pending {
  border-style: solid;
}

.file-card.uploading {
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 16px 30px rgba(124, 58, 237, 0.18);
}

.file-card.paused {
  opacity: 0.96;
}

.file-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.file-thumb {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.25);
  flex-shrink: 0;
}

.file-thumb i {
  font-size: 24px;
}

.file-thumb[data-type="image"] {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
}

.file-thumb[data-type="pdf"] {
  background: linear-gradient(135deg, #ef4444, #f97316);
}

.file-thumb[data-type="doc"] {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
}

.file-thumb[data-type="sheet"] {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.file-thumb[data-type="slide"] {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

.file-thumb[data-type="archive"] {
  background: linear-gradient(135deg, #f97316, #ff8a4a);
}

.file-thumb[data-type="audio"] {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
}

.file-thumb[data-type="video"] {
  background: linear-gradient(135deg, #6366f1, #a855f7);
}

.file-thumb[data-type="text"] {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

.file-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  flex: 1 1 auto;
  min-width: 0;
}

.file-card-info strong {
  display: block;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card-info .muted {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.file-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  position: relative;
  margin-top: 4px;
}

.file-progress span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #6366f1, #a855f7);
  width: 0%;
  transform-origin: left center;
  transition: width 0.45s ease, opacity 0.3s ease;
  opacity: 0.95;
}

.file-card.uploading .file-progress span {
  animation: progressPulse 1.2s ease-in-out infinite;
}

.file-card.paused .file-progress span {
  background: repeating-linear-gradient(
    45deg,
    rgba(148, 163, 184, 0.6),
    rgba(148, 163, 184, 0.6) 6px,
    rgba(226, 232, 240, 0.4) 6px,
    rgba(226, 232, 240, 0.4) 12px
  );
}

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

@keyframes progressPulse {
  0% {
    filter: brightness(0.95);
  }
  50% {
    filter: brightness(1.1);
  }
  100% {
    filter: brightness(0.95);
  }
}

.file-actions {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  flex: 0 0 auto;
}

.file-action-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--fg);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.file-action-btn i {
  font-size: 14px;
}

.file-card-head {
  font-weight: 600;
  margin: 1em 0;
}

.upload-progress {
  margin: 16px 0 12px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(37, 99, 235, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.upload-progress.hidden {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 10px;
}

.upload-progress-head strong {
  font-size: 15px;
}

.upload-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.15);
  overflow: hidden;
}

.upload-progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  border-radius: inherit;
  transition: width 0.3s ease;
}

@media (max-width: 768px) {
  .file-card {
    flex-wrap: wrap;
  }

  .file-actions {
    flex-direction: column;
  }
}

.file-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
}

.file-action-btn.success {
  background: #22c55e;
  color: #fff;
  box-shadow: 0 12px 20px rgba(34, 197, 94, 0.25);
}

.file-action-btn.info {
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 12px 20px rgba(29, 78, 216, 0.2);
}

.file-action-btn.warning {
  background: #f59e0b;
  color: #fff;
  box-shadow: 0 12px 20px rgba(245, 158, 11, 0.22);
}

.file-action-btn.purple {
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 12px 20px rgba(124, 58, 237, 0.25);
}

.file-action-btn.danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 12px 20px rgba(220, 38, 38, 0.25);
}

.file-action-btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
}

.file-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.settings .card {
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

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

.room-actions input {
  flex: 1;
  min-width: 200px;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  background: transparent;
  color: var(--fg);
}

.room-actions .btn {
  background: var(--accent);
  color: #fff;
}

.settings label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.settings section {
  margin-bottom: 24px;
}

.settings label:last-child {
  border-bottom: none;
}

.toggle-field span {
  flex: 1;
  margin-right: 16px;
}

.toggle-switch {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: var(--border);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle-switch .toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.toggle-switch.active {
  background: var(--accent);
}

.toggle-switch.active .toggle-thumb {
  transform: translateX(20px);
}

.toggle-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.modal,
.quick-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(2px);
  transition: opacity 0.3s var(--portal-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.modal.portal-visible,
.quick-modal.portal-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal.portal-closing,
.quick-modal.portal-closing {
  pointer-events: none;
}

.modal [data-portal-surface],
.quick-modal [data-portal-surface] {
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 0.32s var(--portal-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    opacity 0.32s ease;
}

.modal.portal-visible [data-portal-surface],
.quick-modal.portal-visible [data-portal-surface] {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal.portal-closing [data-portal-surface],
.quick-modal.portal-closing [data-portal-surface] {
  transform: translateY(30px) scale(0.95);
  opacity: 0;
}

.modal-content {
  position: relative;
  width: min(520px, 90%);
  background: var(--card);
  border-radius: 32px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.quick-card {
  width: min(420px, 90%);
  border-radius: 32px;
  padding: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.quick-body hr{
  width: 100%;
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

.quick-body p {
  text-align: center;
}

.quick-code {
  font-size: 28px;
  letter-spacing: 8px;
  font-weight: 600;
  padding: 10px 20px;
  background: #0000000f;
  border-radius: 8px;
  width: 100%;
  text-align: center;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

[data-theme='dark'] .quick-code  {
  background: #ffffff42;
}

.quick-code:focus-visible {
  outline: none;
  border-color: var(--accent);
}

.quick-code:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.12);
}

.quick-code.is-disabled,
.quick-code.is-disabled:hover {
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.7;
}

.quick-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: space-between;
  flex-wrap: wrap;
}

.quick-actions .btn {
  flex: 1 1 30%;
}

[data-theme='dark'] #quickCloseBtn {
  background: rgb(255 255 255 / 31%);
}

.quick-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 18px;
}

.quick-inputs input {
  width: 48px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #0000000f;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  text-transform: uppercase;
}

[data-theme='dark'] .quick-inputs input {
  background: #ffffff42;
  color: white;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--accent-soft);
  border: none;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  margin: 0 auto;
  transform: translateX(-50%);
  bottom: 20px;
  z-index: 900;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
  background: var(--card);
  border-radius: 16px;
  padding: 2px 16px;
  box-shadow: 0 24px 55px -24px rgba(53, 111, 246, 0.45);
  width: min(520px, calc(100% - 32px));
  --nav-indicator-left: 0px;
  --nav-indicator-width: 0px;
}

.bottom-nav::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: var(--nav-indicator-left);
  width: var(--nav-indicator-width);
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
  transition: left 0.3s ease, width 0.3s ease;
  pointer-events: none;
}

.nav-btn {
  background: transparent;
  border: none;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  cursor: pointer;
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  overflow: hidden;
  text-align: center;
  transition: color 0.2s ease;
}

.margin0{
  margin:0;
}

p.margin0{
  color: #a0a0a0;
  font-size: 12px;
}

.nav-btn.active {
  color: var(--fg);
}

/* .bottom-nav .active i.fa-regular,.bottom-nav .active i.fa-solid{
  background: #0b1120;
} */

.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 100px;
  display: flex;
  flex-direction: column;
  z-index: 1200;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  color: var(--fg);
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
  margin-bottom: 10px;
}

[data-theme='dark'] .toast-item {
  background: rgba(17, 24, 39, 0.92);
  border-color: rgba(148, 163, 184, 0.15);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

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

.toast-item.leaving {
  opacity: 0;
  transform: translateY(-20px);
}

.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.toast-text {
  line-height: 1.4;
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .ripple-effect,
  .file-card.uploading .file-progress span,
  .message-card {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .modal,
  .quick-modal {
    transition: none;
  }
}

.form-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.form-grid input {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: transparent;
  color: var(--fg);
}

.form-grid .span-full {
  grid-column: 1 / -1;
}

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

  .app-shell {
    padding: 0px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .room-actions {
    flex-direction: column;
  }

  .bottom-nav {
    width: 100%;
    border-radius: unset;
    justify-content: space-between;
    bottom: 0px;
    transform: translateX(-50%);
    box-shadow: unset;
  }

  .bottom-nav::after {
    display: none;
  }

  .nav-btn {
    flex: 1 1 calc(50% - 12px);
    margin: 4px 0;
  }

  .message-list {
    max-height: 430px;
  }

  .message-card{
    min-width: auto;
  }
}
@media (max-width: 600px) {
  main{
    padding: 0 12px;
  }
  .logo-text {
    font-size: 16px;
  }
  .logo-sub {
    font-size: 12px;
  }
  .app-header {
    padding: 12px 16px;
  }
  .header-controls {
    gap: unset;
  }
  .hero-actions {
    margin: 20px 0 0 0;
  }
  .language-toggle #languageToggleLabel {
    display: none;
  }
  .hero-text {
    padding: 20px;
  }
  #landing {
    gap: 1em;
  }
  .nav-btn {
    padding: 6px 12px;
  }
  .quick-actions .btn{
    flex: 1 1 45%;
  }
  .file-card-info {
    flex-direction: column;
    align-items: flex-start;
  }
  .file-card {
    justify-content: center;
  }
  .file-card-info strong {
    width: 300px;
  }
  .file-thumb {
    width: 40px;
    height: 40px;
  }
  .massageButton .btn {
    padding: 6px 21px;
  }
  .file-thumb i {
    font-size: 20px;
  }
  .file-actions{
    flex-direction: row;
  }
  .language-menu {
    right: -18px;
  }
}
.language-toggle #languageToggleLabel {
  font-weight: 600;
  font-size: 14px;
}
