* { box-sizing: border-box; }
:root {
  --bg: #f8f3df;
  --panel: #fffaf0;
  --panel-2: #fff4c7;
  --ink: #2d2b25;
  --muted: #756f61;
  --line: rgba(79, 66, 36, .16);
  --green: #5f8f4e;
  --green-dark: #49743c;
  --yellow: #ffd95a;
  --chat: #ffffff;
  --other: #f2f4e9;
}
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #fff7cd, var(--bg) 45%, #eaf4df);
  color: var(--ink);
  overflow: hidden;
}
.daisy-bg span {
  position: fixed;
  color: rgba(255, 211, 67, .38);
  font-size: 92px;
  z-index: 0;
  pointer-events: none;
  filter: blur(.2px);
}
.daisy-bg span:nth-child(1) { left: 4%; top: 7%; transform: rotate(-18deg); }
.daisy-bg span:nth-child(2) { right: 6%; top: 11%; transform: rotate(22deg); }
.daisy-bg span:nth-child(3) { left: 10%; bottom: 8%; transform: rotate(16deg); }
.daisy-bg span:nth-child(4) { right: 12%; bottom: 4%; transform: rotate(-12deg); }
.daisy-bg span:nth-child(5) { left: 48%; top: 3%; font-size: 58px; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
#app { position: relative; z-index: 1; }
.center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}
.login-card {
  width: min(360px, 100%);
  background: rgba(255, 250, 240, .94);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(71, 61, 28, .22);
}
.login-card .flower { font-size: 42px; margin-bottom: 8px; }
.login-card h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.04em; }
.login-card p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.login-card input {
  width: 100%; border: 1px solid var(--line); border-radius: 14px;
  background: white; color: var(--ink); padding: 12px 13px; outline: 0;
}
.login-card input:focus, .composer textarea:focus { box-shadow: 0 0 0 3px rgba(95, 143, 78, .18); border-color: var(--green); }
.primary-btn {
  width: 100%; margin-top: 12px; border: 0; border-radius: 14px; padding: 12px 14px;
  background: var(--green); color: white; font-weight: 800; cursor: pointer;
}
.primary-btn:hover { background: var(--green-dark); }
.error { min-height: 20px; color: #b04545; font-size: 13px; margin-top: 10px; }
.chat-shell {
  height: 100vh;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr) 205px;
  background: rgba(255,250,240,.92);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-shadow: 0 0 80px rgba(71, 61, 28, .18);
}
.leftbar, .rightbar { padding: 12px; background: rgba(255,244,199,.82); overflow-y: auto; }
.leftbar { border-right: 1px solid var(--line); }
.rightbar { border-left: 1px solid var(--line); }
.brand { font-size: 17px; font-weight: 900; padding: 10px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.section-title { color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 900; margin: 12px 0 8px; }
.channel { background: rgba(95,143,78,.16); border: 1px solid rgba(95,143,78,.16); border-radius: 11px; padding: 9px 10px; font-size: 14px; font-weight: 800; }
.small-btn { width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.55); color: var(--ink); border-radius: 11px; padding: 9px; cursor: pointer; margin-top: 8px; }
.small-btn:hover { background: white; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 11px; }
.chat-main { min-width: 0; display: flex; flex-direction: column; height: 100vh; background: rgba(255,255,255,.45); }
.topbar { height: 52px; flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 16px; border-bottom: 1px solid var(--line); background: rgba(255,250,240,.94); }
.topbar h2 { margin: 0; font-size: 16px; }
.topbar span { color: var(--muted); font-size: 13px; }

.mobile-online {
  display: none;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding: 8px 12px;
  background: rgba(255,244,199,.72);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.mobile-online-title {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.mobile-online-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 150px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(113,90,54,.12);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}
.mobile-online-pill .status-dot {
  width: 8px;
  height: 8px;
  margin-left: 0;
  flex: 0 0 auto;
}
.mobile-online-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages { flex: 1; overflow-y: auto; padding: 14px 16px 8px; }
.empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 14px; }
.message { display: flex; gap: 10px; padding: 8px 0; max-width: 790px; }
.message:hover { background: rgba(255, 217, 90, .10); margin-left: -8px; padding-left: 8px; border-radius: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); color: #5f4a00; display: grid; place-items: center; font-weight: 900; font-size: 13px; flex: 0 0 auto; border: 2px solid white; }
.message-body { min-width: 0; flex: 1; }
.message-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.name { font-weight: 900; font-size: 14px; color: var(--ink); }
.time { color: var(--muted); font-size: 11px; }
.text { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.38; }
.chat-img { display: block; max-width: min(285px, 100%); max-height: 235px; object-fit: contain; border-radius: 14px; margin-top: 7px; border: 1px solid var(--line); cursor: zoom-in; background: white; }
.image-actions { display: flex; gap: 7px; margin-top: 6px; }
.tiny-link { color: var(--green-dark); font-weight: 800; font-size: 12px; text-decoration: none; }
.composer-wrap { padding: 10px 16px 16px; background: rgba(255,250,240,.94); }
.preview { display: none; align-items: center; gap: 8px; margin-bottom: 8px; background: rgba(255,244,199,.85); border: 1px solid var(--line); border-radius: 12px; padding: 8px; font-size: 13px; }
.preview img { width: 42px; height: 42px; object-fit: cover; border-radius: 9px; }
.preview button { margin-left: auto; background: transparent; border: 0; color: #b04545; cursor: pointer; font-weight: 800; }
.emoji-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  margin-bottom: 8px;
  box-shadow: 0 10px 30px rgba(71, 61, 28, .12);
}
.emoji-panel.hidden { display: none; }
.emoji-choice {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: rgba(255,244,199,.65);
  cursor: pointer;
  font-size: 18px;
}
.emoji-choice:hover { background: rgba(255,217,90,.55); transform: translateY(-1px); }
.composer { display: flex; align-items: end; gap: 8px; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 8px; }
.send-btn, .emoji-btn { width: 36px; height: 34px; border: 0; border-radius: 11px; cursor: pointer; flex: 0 0 auto; }
.emoji-btn { background: rgba(255,217,90,.45); font-size: 18px; }
.emoji-btn:hover { background: rgba(255,217,90,.7); }
.upload-btn {
  min-height: 34px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  background: rgba(95,143,78,.14);
  color: var(--green-dark);
  font-weight: 900;
  font-size: 13px;
  white-space: nowrap;
}
.upload-btn:hover { background: rgba(95,143,78,.24); }
.upload-icon { font-size: 17px; line-height: 1; }
.upload-hint { margin-top: 6px; color: var(--muted); font-size: 12px; padding-left: 4px; }
.send-btn { background: var(--green); color: white; font-weight: 900; }
.send-btn:hover { background: var(--green-dark); }
.composer textarea { flex: 1; min-height: 34px; max-height: 120px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 8px 4px 4px; font-size: 14px; line-height: 1.35; }
.user-row { display: flex; align-items: center; gap: 9px; padding: 7px 5px; border-radius: 10px; font-size: 14px; }
.user-row:hover { background: rgba(255,255,255,.5); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #23a559; margin-left: auto; box-shadow: 0 0 0 3px rgba(35,165,89,.13); }
.modal { position: fixed; inset: 0; background: rgba(22,20,13,.68); z-index: 10; display: grid; place-items: center; padding: 18px; }
.modal.hidden { display: none; }
.modal-card { position: relative; max-width: min(900px, 96vw); max-height: 92vh; background: var(--panel); border-radius: 20px; padding: 14px; box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.modal-card img { display: block; max-width: 100%; max-height: 74vh; border-radius: 14px; object-fit: contain; background: white; }
.modal-close { position: absolute; top: -12px; right: -12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ink); color: white; font-size: 24px; cursor: pointer; }
.download-btn { display: inline-block; margin-top: 10px; background: var(--green); color: white; text-decoration: none; border-radius: 12px; padding: 10px 14px; font-weight: 900; }
@media (max-width: 860px) {
  body { overflow: auto; }
  .chat-shell { grid-template-columns: 1fr; height: 100dvh; }
  .leftbar, .rightbar { display: none; }
  .mobile-online { display: flex; }
}

@media (max-width: 560px) {
  .upload-text { display: none; }
  .upload-btn { padding: 0 10px; }
  .upload-hint { font-size: 11px; }
}
