﻿@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&display=swap");

:root,
html[data-theme="dark"] {
  --bg: #05070d;
  --bg-elevated: #0d0d0d;
  --sidebar: rgba(16, 22, 36, 0.55);
  --sidebar-solid: #070a12;
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --text: #f2f5ff;
  --muted: #9aa3b8;
  --hover: rgba(255, 255, 255, 0.08);
  --composer: #303030;
  --composer-border: transparent;
  --btn-soft: rgba(255, 255, 255, 0.1);
  --btn-solid: #ffffff;
  --btn-solid-text: #0d0d0d;
  --send: #5a5a5a;
  --send-active: #ffffff;
  --send-active-icon: #0d0d0d;
  --bubble-user: #2f2f2f;
  --bubble-ai: transparent;
  --shadow: none;
}

html[data-theme="light"] {
  --bg: #eef2f8;
  --bg-elevated: #f7f7f8;
  --sidebar: rgba(255, 255, 255, 0.55);
  --sidebar-solid: #f4f7fc;
  --sidebar-border: rgba(15, 23, 42, 0.08);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --text: #0f172a;
  --muted: #64748b;
  --hover: rgba(15, 23, 42, 0.05);
  --composer: #f4f4f4;
  --composer-border: #e5e5e5;
  --btn-soft: rgba(255, 255, 255, 0.7);
  --btn-solid: #0d0d0d;
  --btn-solid-text: #ffffff;
  --send: #cfcfcf;
  --send-active: #0d0d0d;
  --send-active-icon: #ffffff;
  --bubble-user: #e8e8e8;
  --bubble-ai: transparent;
  --shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
button,
input,
textarea,
select {
  font-family: inherit;
}

.app {
  display: flex;
  height: 100dvh;
  width: 100%;
  background: var(--bg);
}

.sidebar {
  position: relative;
  width: 272px;
  flex: 0 0 272px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  margin: 10px 0 10px 10px;
  padding: 12px 10px 12px;
  border-radius: 22px;
  border: 1px solid var(--sidebar-border);
  background: var(--sidebar);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 18px 48px rgba(0, 0, 0, 0.22);
  isolation: isolate;
}
.sidebar > * { position: relative; z-index: 1; }

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 12px;
}

.brand-block {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 42px);
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--sidebar-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.brand-logo {
  height: 42px;
  width: 168px;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  display: block;
}
html[data-theme="dark"] .brand-logo {
  filter: brightness(0) invert(1);
}

.icon-btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--glass);
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.icon-btn:hover {
  background: var(--glass-strong);
  border-color: var(--sidebar-border);
  color: var(--text);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 2px 4px 0;
  overflow: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 150, 220, 0.45) transparent;
}
.nav::-webkit-scrollbar {
  width: 8px;
}
.nav::-webkit-scrollbar-track {
  margin: 8px 0;
  background: transparent;
  border-radius: 999px;
}
.nav::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
  background-image: linear-gradient(
    180deg,
    rgba(120, 170, 255, 0.55),
    rgba(0, 87, 255, 0.35),
    rgba(120, 170, 255, 0.45)
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.nav::-webkit-scrollbar-thumb:hover {
  background-image: linear-gradient(
    180deg,
    rgba(160, 200, 255, 0.75),
    rgba(43, 124, 255, 0.55),
    rgba(160, 200, 255, 0.65)
  );
}
.nav::-webkit-scrollbar-button,
.nav::-webkit-scrollbar-corner {
  display: none;
  width: 0;
  height: 0;
}
html[data-theme="light"] .nav {
  scrollbar-color: rgba(0, 87, 255, 0.35) transparent;
}
html[data-theme="light"] .nav::-webkit-scrollbar-thumb {
  background-image: linear-gradient(
    180deg,
    rgba(0, 87, 255, 0.35),
    rgba(0, 87, 255, 0.22),
    rgba(0, 87, 255, 0.32)
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.nav-section {
  margin: 14px 8px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-group {
  margin: 4px 0;
}
.nav-group > summary {
  list-style: none;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 4px 4px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  user-select: none;
}
.nav-section-toggle:hover { background: var(--hover); color: var(--text); }
.nav-section-toggle .chev { transition: transform 0.15s ease; }
.nav-group[open] > .nav-section-toggle .chev { transform: rotate(0deg); }
.nav-group:not([open]) > .nav-section-toggle .chev { transform: rotate(-90deg); }
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: #0057FF;
  color: #fff;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.nav-group-body { display: flex; flex-direction: column; gap: 2px; }

.calc-group > .nav-section-toggle { margin-top: 12px; }
.calc-menu {
  margin: 4px 4px 8px;
  padding: 14px 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--sidebar-border);
  background: rgba(0, 0, 0, 0.22);
}
html[data-theme="light"] .calc-menu {
  background: rgba(255, 255, 255, 0.65);
}
.calc-menu-head {
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
html[data-theme="light"] .calc-menu-head {
  border-bottom-color: rgba(15, 23, 42, 0.1);
}
.calc-menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.calc-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.calc-col-title {
  margin: 0 0 2px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.calc-col a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  line-height: 1.35;
  transition: color 0.15s ease;
}
.calc-col a:hover { color: var(--text); }
@media (min-width: 1100px) {
  .calc-group > .calc-menu {
    display: none;
  }
  .calc-mega {
    position: fixed;
    z-index: 70;
    top: 72px;
    left: 292px;
    width: min(720px, calc(100vw - 320px));
    padding: 22px 24px 20px;
    border-radius: 18px;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  }
  html[data-theme="light"] .calc-mega {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.16);
  }
  .calc-mega[data-open="1"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
  .calc-mega .calc-menu-head {
    font-size: 0.8rem;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
  }
  html[data-theme="light"] .calc-mega .calc-menu-head {
    color: #0f172a;
    border-bottom-color: rgba(15, 23, 42, 0.1);
  }
  .calc-mega .calc-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
  }
  .calc-mega .calc-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .calc-mega .calc-col-title {
    margin: 0 0 2px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
  }
  html[data-theme="light"] .calc-mega .calc-col-title { color: #0f172a; }
  .calc-mega .calc-col a {
    color: #b4b4b4;
    text-decoration: none;
    font-size: 0.88rem;
    line-height: 1.35;
  }
  html[data-theme="light"] .calc-mega .calc-col a { color: #64748b; }
  .calc-mega .calc-col a:hover { color: #fff; }
  html[data-theme="light"] .calc-mega .calc-col a:hover { color: #0f172a; }
}
@media (max-width: 1099px) {
  .calc-mega { display: none !important; }
}

.nav-item {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 14px;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.nav-item:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04));
  border-color: var(--sidebar-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.nav-item.active {
  background: linear-gradient(180deg, rgba(0, 87, 255, 0.28), rgba(0, 87, 255, 0.08));
  border-color: rgba(0, 87, 255, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 8px 20px rgba(0, 87, 255, 0.12);
}
html[data-theme="light"] .nav-item:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.45));
}
html[data-theme="light"] .nav-item.active {
  background: linear-gradient(180deg, rgba(0, 87, 255, 0.14), rgba(0, 87, 255, 0.05));
}
.nav-item .nav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item .nav-label em {
  font-style: normal;
  color: var(--muted);
  font-weight: 400;
}
.nav-item .lock {
  margin-left: auto;
  opacity: 0.55;
  flex: 0 0 auto;
}
.nav-item.locked { color: var(--text); opacity: 0.85; }
.nav-item.locked.is-popover-open {
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04));
  border-color: var(--sidebar-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
html[data-theme="light"] .nav-item.locked.is-popover-open {
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.45));
}

.lock-popover {
  position: fixed;
  z-index: 80;
  width: min(292px, calc(100vw - 24px));
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1a1a1a;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.lock-popover[data-open="1"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.lock-popover-art {
  height: 118px;
  background:
    radial-gradient(120% 90% at 18% 20%, rgba(186, 230, 253, 0.95), transparent 55%),
    radial-gradient(90% 80% at 78% 30%, rgba(191, 219, 254, 0.9), transparent 58%),
    radial-gradient(70% 70% at 55% 85%, rgba(224, 231, 255, 0.75), transparent 60%),
    linear-gradient(145deg, #dbeafe 0%, #bae6fd 42%, #e0e7ff 100%);
}
.lock-popover-body {
  padding: 18px 18px 16px;
  background: #1c1c1c;
}
.lock-popover-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.25;
}
.lock-popover-desc {
  margin: 0 0 16px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #b4b4b4;
}
.lock-popover-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lock-btn-login,
.lock-btn-signup {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.lock-btn-login {
  background: #fff;
  color: #0d0d0d;
}
.lock-btn-login:hover { background: #f0f0f0; }
.lock-btn-signup {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.lock-btn-signup:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
}
html[data-theme="light"] .lock-popover {
  border-color: rgba(15, 23, 42, 0.1);
  background: #fff;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.18);
}
html[data-theme="light"] .lock-popover-body { background: #fff; }
html[data-theme="light"] .lock-popover-title { color: #0f172a; }
html[data-theme="light"] .lock-popover-desc { color: #64748b; }
html[data-theme="light"] .lock-btn-login {
  background: #0d0d0d;
  color: #fff;
}
html[data-theme="light"] .lock-btn-login:hover { background: #222; }
html[data-theme="light"] .lock-btn-signup {
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.18);
}
html[data-theme="light"] .lock-btn-signup:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.3);
}
@media (max-width: 900px) {
  .lock-popover { display: none !important; }
}

.sidebar-foot {
  margin-top: 10px;
  padding: 14px 12px 12px;
  border-radius: 18px;
  border: 1px solid var(--sidebar-border);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.03)),
    var(--glass);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 28px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(14px);
}
.foot-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
}
.foot-copy {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.btn-login-side {
  display: block;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(180deg, #2b7cff, #0057FF);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 22px rgba(0, 87, 255, 0.28);
}
.btn-login-side:hover { filter: brightness(1.06); }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  gap: 12px;
}
.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.model-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.model-btn:hover { background: var(--hover); }

.theme-toggle {
  appearance: none;
  border: 1px solid var(--sidebar-border);
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--hover); }
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }

.btn-login,
.btn-signup {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 550;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  white-space: nowrap;
}
.btn-login {
  color: var(--btn-solid-text);
  background: var(--btn-solid);
  border: 1px solid transparent;
}
html[data-theme="dark"] .btn-login {
  color: #0d0d0d;
  background: #ffffff;
}
html[data-theme="light"] .btn-login {
  color: #0d0d0d;
  background: #ffffff;
  border-color: #d0d0d0;
  box-shadow: var(--shadow);
}
.btn-signup {
  color: #ffffff;
  background: #2f2f2f;
}
html[data-theme="light"] .btn-signup {
  color: #ffffff;
  background: #0d0d0d;
}

.stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem 1.5rem;
  overflow: visible;
}
.hero-stack {
  width: min(48rem, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  overflow: visible;
}
.empty h1 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.55rem, 2.8vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
  max-width: min(48rem, 100%);
  width: 100%;
  white-space: nowrap;
}
.hero-sub {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  font-family: "Sora", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.45;
}
.hero-attach {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  row-gap: 0;
  margin-top: 0.15rem;
}
.hero-robot-wrap {
  width: min(240px, 52vw);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  line-height: 0;
  overflow: hidden;
}
.hero-robot {
  width: 100%;
  height: 100%;
  max-width: 240px;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  margin: 0;
  vertical-align: bottom;
  filter: drop-shadow(0 8px 22px rgba(0, 87, 255, 0.22));
  user-select: none;
  pointer-events: none;
}
.hero-composer {
  width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
}
.hero-composer .composer {
  border-radius: 1.5rem;
  min-height: 76px;
  align-items: center;
  margin: 0;
}
.hero-composer .composer textarea {
  min-height: 44px;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  text-align: left;
}

.thread {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.thread.hidden, .empty.hidden { display: none; }
.sticky-composer {
  width: 100%;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--sidebar-border);
  background: linear-gradient(180deg, transparent, var(--bg) 28%);
}
.messages {
  width: min(48rem, 100%);
  margin: 0 auto;
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 150, 220, 0.4) transparent;
}
.msg { display: flex; gap: 0.75rem; max-width: 100%; }
.msg.user { justify-content: flex-end; }
.msg.assistant { justify-content: flex-start; }
.bubble {
  max-width: min(42rem, 92%);
  padding: 0.85rem 1rem;
  border-radius: 1.35rem;
  font-size: 0.975rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.msg.user .bubble { background: var(--bubble-user); }
.msg.assistant .bubble { background: var(--bubble-ai); padding-left: 0; }
.avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: #0057FF;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex: 0 0 auto;
  margin-top: 0.35rem;
}
.thinking { color: var(--muted); }

.composer-wrap {
  width: min(48rem, 100%);
  margin: 0 auto;
  padding: 0 1rem 0.85rem;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  background: var(--composer);
  border: 1px solid var(--composer-border);
  border-radius: 999px;
  padding: 0.55rem 0.55rem 0.55rem 0.65rem;
  box-shadow: var(--shadow);
}
.composer textarea {
  flex: 1;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
  max-height: 160px;
  min-height: 28px;
  padding: 0.45rem 0.25rem;
}
.composer textarea::placeholder { color: var(--muted); }
.composer-icon {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.composer-icon:hover { background: var(--hover); }
.send {
  appearance: none;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--send);
  color: var(--text);
  cursor: pointer;
  flex: 0 0 auto;
}
.send:not(:disabled) {
  background: var(--send-active);
  color: var(--send-active-icon);
}
.send:disabled { opacity: 0.7; cursor: not-allowed; }

.fine {
  margin: 0.65rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}
.fine a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 20;
}
.mobile-only { display: none; }

@media (max-width: 860px) {
  .empty h1 {
    white-space: normal;
    font-size: clamp(1.35rem, 5.2vw, 1.75rem);
  }
  body { overflow: auto; }
  .mobile-only { display: grid; }
  .sidebar {
    position: fixed;
    top: 10px;
    left: 10px;
    bottom: 10px;
    z-index: 30;
    height: auto;
    margin: 0;
    transform: translateX(calc(-100% - 20px));
    transition: transform 0.22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .backdrop[data-open="1"] { display: block; }
  .btn-signup { display: none; }
  .theme-toggle span { display: none; }
}
