:root{
  --bg:#eef1f5;
  --card:#f7f8fb;
  --card-2:#ffffff;
  --text:#17181c;
  --muted:#72767f;
  --line:#dde1e8;
  --pill:#fafafa;
  --shadow:0 8px 24px rgba(20,20,20,.06);
  --shadow-soft:0 4px 14px rgba(20,20,20,.04);
  --radius-xl:34px;
  --radius-lg:26px;
  --radius-md:20px;
  --primary:#e9edf8;
  --primary-deep:#dfe6fb;
  --success:#1f8f4e;
  --danger:#c62828;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:'Inter',sans-serif;
  background:var(--bg);
  color:var(--text);
}

a{text-decoration:none;color:inherit}
button,input,textarea{font:inherit}

.app-shell{
  min-height:100vh;
  background:linear-gradient(180deg,#eef1f5 0%, #eceff3 100%);
}

.mobile-app{
  max-width:720px;
  margin:0 auto;
  min-height:100vh;
  position:relative;
  padding-bottom:160px;
}

/* Topbar */
.app-topbar{
  position:sticky;
  top:0;
  z-index:60;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 18px 10px;
  background:rgba(238,241,245,0.88);
  backdrop-filter:blur(10px);
}

.app-title{
  font-size:20px;
  font-weight:800;
  letter-spacing:-0.3px;
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:14px;
}

.avatar-badge{
  width:42px;
  height:42px;
  border-radius:50%;
  background:#ffffff;
  border:2px solid #d8deea;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  box-shadow:var(--shadow-soft);
}

.topbar-menu{
  width:42px;
  height:42px;
  border:none;
  border-radius:14px;
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:#222;
}

.topbar-menu svg,
.topbar-icon svg,
.more-btn svg{
  width:24px;
  height:24px;
  display:block;
}

.topbar-icon{
  width:42px;
  height:42px;
  border:none;
  border-radius:14px;
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:#222;
}

.more-btn{
  width:42px;
  height:42px;
  border:none;
  border-radius:14px;
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:#222;
}

/* Drawer */
.side-drawer{
  position:fixed;
  top:0;
  left:0;
  bottom:0;
  width:min(78vw, 340px);
  background:#eef1f5;
  z-index:120;
  transform:translateX(-100%);
  transition:.25s ease;
  box-shadow:20px 0 40px rgba(0,0,0,.08);
}

.side-drawer.open{
  transform:translateX(0);
}

.drawer-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.18);
  z-index:110;
  opacity:0;
  visibility:hidden;
  transition:.2s ease;
}

.drawer-overlay.show{
  opacity:1;
  visibility:visible;
}

.drawer-inner{
  padding:24px 18px 100px;
}

.drawer-search{
  background:#fff;
  border-radius:18px;
  padding:18px 18px;
  color:#7b818c;
  margin-bottom:18px;
  box-shadow:var(--shadow-soft);
}

.drawer-item{
  display:block;
  padding:16px 12px;
  font-size:18px;
  font-weight:700;
  border-radius:16px;
  color:#20242c;
}

.drawer-item.active{
  background:#f8f9fb;
}

.drawer-section-title{
  margin:18px 0 12px;
  font-size:16px;
  font-weight:800;
  color:#2b3038;
}

.drawer-chat{
  font-size:16px;
  color:#4d5562;
  line-height:1.4;
  padding:12px 6px;
}

/* Profile menu */
.profile-menu{
  position:absolute;
  top:66px;
  right:18px;
  width:220px;
  background:#fff;
  border:1px solid #e3e7ee;
  border-radius:20px;
  box-shadow:0 20px 40px rgba(20,20,20,.10);
  overflow:hidden;
  z-index:140;
}

.profile-option{
  width:100%;
  padding:16px 18px;
  border:none;
  background:#fff;
  text-align:left;
  font-size:16px;
  font-weight:600;
  cursor:pointer;
  border-bottom:1px solid #eef1f5;
}

.profile-option:last-child{
  border-bottom:none;
}

/* Hero */
.hero-clean{
  padding:30px 22px 10px;
}

.hello-line{
  margin:0 0 8px;
  font-size:22px;
  font-weight:700;
}

.hero-heading{
  margin:0;
  font-size:clamp(42px, 9vw, 68px);
  line-height:1.02;
  letter-spacing:-2px;
  font-weight:800;
}

.quick-actions{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  margin-top:28px;
}

.quick-pill{
  border:none;
  background:#f9f9fa;
color:#333;
  padding:18px 24px;
  border-radius:999px;
  font-size:18px;
  font-weight:600;
  box-shadow:var(--shadow-soft);
  cursor:pointer;
}

/* Chat area */
.chat-area{
  padding:8px 18px 0;
}

.chat-list{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.chat-empty{
  background:rgba(255,255,255,.58);
  border:1px solid rgba(221,225,232,.8);
  border-radius:30px;
  box-shadow:var(--shadow);
  padding:24px;
  color:#7c828d;
}

.chat-empty strong{
  display:block;
  color:#1e2025;
  font-size:20px;
  margin-bottom:8px;
}

.chat-row{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.user-bubble{
  align-self:flex-end;
  max-width:85%;
  background:#e8edf6;
  color:#1f232a;
  padding:16px 20px;
  border-radius:24px;
  font-size:18px;
  font-weight:600;
  line-height:1.45;
}

.bot-row{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.bot-line{
  display:flex;
  align-items:center;
  gap:10px;
  color:#20242c;
  font-weight:700;
  font-size:16px;
}

.bot-star{
  width:24px;
  height:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  color:#4f8cff;
}

.loading-line{
  display:flex;
  align-items:center;
  gap:10px;
  color:#667085;
  font-size:15px;
}

.dot-loader{
  display:inline-flex;
  gap:4px;
}

.dot-loader span{
  width:7px;
  height:7px;
  border-radius:50%;
  background:#a4acb9;
  animation:bounce 1.2s infinite ease-in-out;
}

.dot-loader span:nth-child(2){animation-delay:.15s}
.dot-loader span:nth-child(3){animation-delay:.3s}

@keyframes bounce{
  0%, 80%, 100%{transform:scale(.7);opacity:.6}
  40%{transform:scale(1);opacity:1}
}

.image-card{
  background:#fff;
  border:1px solid #e2e6ed;
  border-radius:28px;
  overflow:hidden;
  box-shadow:var(--shadow);
}

.image-card img{
  display:block;
  width:100%;
  height:auto;
  max-height:520px;
  object-fit:cover;
}

.image-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  padding:14px 14px 16px;
}

.icon-action{
  border:none;
  background:#f6f8fb;
  border-radius:14px;
  padding:12px 14px;
  font-weight:700;
  cursor:pointer;
  color:#2c3440;
}

.notice{
  margin:10px 18px 0;
  font-size:14px;
  color:#5f6776;
}
.notice.error{color:var(--danger)}
.notice.success{color:var(--success)}

.hidden{display:none !important}

/* Bottom bar */
.bottom-bar-wrap{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:80;
  display:flex;
  justify-content:center;
  pointer-events:none;
}

.bottom-bar{
  width:min(720px, 100%);
  margin:0 auto;
  background:rgba(249,249,251,.97);
  border-top-left-radius:34px;
  border-top-right-radius:34px;
  box-shadow:0 -10px 30px rgba(20,20,20,.06);
  padding:18px 18px calc(18px + env(safe-area-inset-bottom));
  pointer-events:auto;
}

.bottom-input-row{
  margin-bottom:16px;
}

.bottom-input{
  width:100%;
  border:none;
  outline:none;
  background:transparent;
  color:#1f1f24;
  font-size:24px;
  font-weight:500;
}

.bottom-input::placeholder{
  color:#80848d;
}

.bottom-tools{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.left-tools,
.right-tools{
  display:flex;
  align-items:center;
  gap:12px;
}

.circle-btn{
  width:52px;
  height:52px;
  border:none;
  border-radius:50%;
  background:#fff;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:28px;
  box-shadow:var(--shadow-soft);
  color:#222;
}

.circle-btn.soft{
  background:#f8f8fa;
}

.circle-btn.primary{
  background:#e9edf8;
}

.circle-btn svg{
  width:24px;
  height:24px;
}

.mode-pill{
  border:none;
  background:#fff;
  color:#3c4048;
  padding:14px 22px;
  border-radius:999px;
  font-weight:700;
  font-size:18px;
  box-shadow:var(--shadow-soft);
  cursor:pointer;
}

.upload-popup{
  position:absolute;
  bottom:112px;
  left:18px;
  background:#fff;
  border:1px solid #e3e7ee;
  border-radius:24px;
  box-shadow:0 20px 40px rgba(20,20,20,.12);
  overflow:hidden;
  width:220px;
  pointer-events:auto;
}

.upload-option{
  width:100%;
  border:none;
  background:#fff;
  padding:18px 20px;
  text-align:left;
font-size:19px;
  font-weight:600;
  border-bottom:1px solid #eef1f5;
  cursor:pointer;
}

.upload-option:last-child{
  border-bottom:none;
}

.hidden-file{
  display:none;
}

/* Desktop */
@media (min-width: 900px){
  .mobile-app{
    max-width:1000px;
  }

  .chat-area{
    max-width:820px;
    margin:0 auto;
  }

  .hero-clean{
    max-width:820px;
    margin:0 auto;
    padding-top:36px;
  }

  .quick-actions{
    max-width:800px;
  }

  .bottom-bar{
    width:min(900px, calc(100% - 24px));
  }
}

/* Mobile */
@media (max-width: 640px){
  .app-topbar{
    padding:14px 14px 8px;
  }

  .hero-clean{
    padding:22px 16px 8px;
  }

  .hero-heading{
    font-size:28px;
    letter-spacing:-1.2px;
  }

  .hello-line{
    font-size:18px;
  }

  .quick-actions{
    gap:10px;
  }

  .quick-pill{
    width:100%;
    justify-content:flex-start;
    text-align:left;
    padding:16px 18px;
    font-size:16px;
  }

  .chat-area{
    padding:8px 12px 0;
  }

  .chat-empty{
    padding:18px;
    border-radius:22px;
  }

  .chat-empty strong{
    font-size:18px;
  }

  .user-bubble{
    max-width:92%;
    font-size:16px;
    padding:14px 16px;
    border-radius:20px;
  }

  .bottom-bar{
    padding:14px 14px calc(14px + env(safe-area-inset-bottom));
  }

  .bottom-input{
    font-size:20px;
  }

  .circle-btn{
    width:48px;
    height:48px;
  }

  .mode-pill{
    padding:12px 16px;
    font-size:16px;
  }

  .upload-popup{
    left:12px;
    right:12px;
    width:auto;
    bottom:98px;
    border-radius:22px;
  }

  .profile-menu{
    right:12px;
    top:60px;
    width:200px;
  }
}