@font-face {
  font-family: "FK Grotesk Neue";
  src: url("https://frontend-cdn.perplexity.ai/_agi_assets/fonts/FKGroteskNeue.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fcfcf9;
  --bg-elev: #ffffff;
  --bg-soft: #f3f2ee;
  --fg: #13343b;
  --muted: #6b7280;
  --line: #e8e6df;
  --accent: #20808d;
  --accent-2: #1a6f7a;
  --btn: #13343b;
  --btn-fg: #fcfcf9;
  --sans: "FK Grotesk Neue", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --radius: 22px;
  --shadow: 0 12px 40px rgba(19, 52, 59, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 68px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  background: rgba(252, 252, 249, 0.96);
}
.sidebar-top, .sidebar-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.brand {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 12px;
}
.brand img {
  width: 28px;
  height: 28px;
  display: block;
  border-radius: 8px;
}
.side-icon {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.side-icon svg { width: 20px; height: 20px; }
.side-icon:hover, .side-icon.active {
  background: var(--bg-soft);
  color: var(--fg);
}
.avatar-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #20808d, #7ec8c8 55%, #d7c4a8);
  padding: 2px;
}
.avatar-btn span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #fff;
}

.stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(900px 420px at 70% -10%, rgba(32, 128, 141, 0.08), transparent 55%),
    radial-gradient(700px 380px at 10% 110%, rgba(215, 196, 168, 0.12), transparent 50%),
    var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
}
.top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-word {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.mobile-menu {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--fg);
}
.mobile-menu svg { width: 20px; height: 20px; }
.top-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--fg); }
.btn-primary {
  background: var(--btn);
  color: var(--btn-fg);
}
.btn-primary:hover { opacity: 0.94; }

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 24px 18px 40px;
  text-align: center;
}
.hero-title {
  font-size: clamp(30px, 5.4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 28px;
}

.composer {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  text-align: left;
}
.composer-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 6px;
}
.icon-soft {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.icon-soft svg { width: 18px; height: 18px; }
.icon-soft:hover { color: var(--fg); background: var(--bg-soft); }
.composer-input-row input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--fg);
}
.composer-input-row input::placeholder { color: #9ca3af; }
.ask-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.ask-btn:hover { background: var(--accent-2); }
.ask-btn svg { width: 18px; height: 18px; }

.composer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 6px 4px;
  flex-wrap: wrap;
}
.mode-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.mode {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 550;
}
.mode.active, .mode:hover {
  background: var(--bg-soft);
  color: var(--fg);
}
.model-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
}
.model-chip svg { width: 16px; height: 16px; }
.model-chip:hover { color: var(--fg); border-color: #cfcbc2; }

.chips {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.chips button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
}
.chips button:hover {
  color: var(--fg);
  border-color: #cfcbc2;
  background: var(--bg-soft);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  padding: 18px 16px 28px;
}
.foot button {
  background: none;
  border: 0;
  color: #9ca3af;
  font-size: 12px;
}
.foot button:hover { color: var(--muted); }

.wa-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.wa-modal[hidden] { display: none !important; }
.wa-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 52, 59, 0.35);
}
.wa-modal-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  height: min(640px, calc(100vh - 40px));
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}
.wa-modal-panel iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.wa-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: #f4f4f4;
  color: #111;
  font-size: 22px;
}

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-menu { display: grid; place-items: center; }
  .brand-word { display: inline; }
}

@media (min-width: 821px) {
  .brand-word { display: none; }
}
