/* CHATDAY - Mobile First UI */
:root{
  --bg:#0b1020;
  --card:#101a33;
  --card2:#0f1730;
  --text:#eaf0ff;
  --muted:#a9b7df;
  --line:rgba(255,255,255,.10);
  --accent:#6ee7ff;
  --accent2:#ff4fd8;
  --ok:#4ade80;
  --warn:#fbbf24;
  --danger:#fb7185;
  --shadow: 0 10px 24px rgba(0,0,0,.35);
  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 800px at 10% 10%, rgba(110,231,255,.12), transparent 60%),
              radial-gradient(1000px 700px at 90% 20%, rgba(255,79,216,.10), transparent 55%),
              var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.bg-soft{
  background: radial-gradient(1200px 800px at 10% 10%, rgba(110,231,255,.10), transparent 60%),
              radial-gradient(1000px 700px at 90% 20%, rgba(255,79,216,.08), transparent 55%),
              #070b18;
}

a{color:inherit; text-decoration:none}
code{background: rgba(255,255,255,.08); padding:.1rem .35rem; border-radius:8px}

.topbar{
  position:sticky; top:0; z-index:10;
  padding: 14px 14px calc(14px + env(safe-area-inset-top));
  display:flex; align-items:center; justify-content:space-between;
  border-bottom:1px solid var(--line);
  background: rgba(7,11,24,.72);
  backdrop-filter: blur(10px);
}

.topbar-left{display:flex; flex-direction:column; gap:6px}
.topbar-right{display:flex; gap:10px; align-items:center}
.pill{
  display:inline-flex; align-items:center; gap:10px;
  padding:10px 12px;
  background: rgba(255,255,255,.07);
  border:1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.sub{color:var(--muted); font-size:.92rem}

.icon-btn{
  width:42px; height:42px;
  border-radius: 14px;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
}

.container{max-width:980px; margin:0 auto; padding: 16px 14px 110px}

.hero{
  padding: 14px;
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
}
.hero h1{margin:0 0 6px; font-size:1.25rem}
.hero p{margin:0 0 14px; color:var(--muted); line-height:1.35}

.hero-actions{display:flex; gap:10px; flex-wrap:wrap}
.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding: 11px 14px;
  border-radius: 14px;
  font-weight:700;
  display:inline-flex; align-items:center; gap:10px;
  cursor:pointer;
}
.btn:active{transform: translateY(1px)}
.btn.primary{
  border: none;
  background: linear-gradient(135deg, rgba(110,231,255,.95), rgba(255,79,216,.75));
  color:#081022;
}
.btn.danger{background: rgba(251,113,133,.18); border-color: rgba(251,113,133,.25); color: #ffd3da}

.chips{display:flex; gap:10px; margin-top:14px; overflow:auto; padding-bottom: 4px}
.chip{
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
  color:var(--text);
  padding: 10px 12px;
  border-radius:999px;
  font-weight:700;
  display:flex; gap:8px; align-items:center;
  white-space:nowrap;
}
.chip.active{background: rgba(110,231,255,.16); border-color: rgba(110,231,255,.25)}

.list-card{
  margin-top: 14px;
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.list-head{display:flex; justify-content:space-between; padding: 14px; border-bottom:1px solid var(--line)}
.title{font-weight:800}
.muted{color:var(--muted)}
.items{display:flex; flex-direction:column}
.item{
  padding: 14px;
  border-bottom: 1px solid var(--line);
  display:flex; gap:12px;
}
.item:last-child{border-bottom:none}
.bullet{
  width:40px; height:40px; border-radius: 14px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
  flex: 0 0 auto;
}
.item-main{flex:1}
.item-top{display:flex; justify-content:space-between; gap:10px}
.item-title{font-weight:900; line-height:1.15}
.item-meta{color:var(--muted); font-size:.88rem; margin-top:4px}
.item-body{margin-top:8px; color: rgba(234,240,255,.92); line-height:1.35}
.item-actions{display:flex; gap:8px; align-items:flex-start}
.small-btn{
  width:40px; height:40px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  display:inline-flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.badge{
  font-size:.72rem;
  padding: 4px 8px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  margin-left:8px;
}

.empty{padding: 26px 14px; text-align:center}
.empty-ico{font-size:2.2rem; color:rgba(255,255,255,.25)}
.empty h3{margin: 10px 0 6px}
.empty p{margin:0; color:var(--muted)}

.auth-wrap{min-height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; padding: 20px 14px}
.brand{text-align:center; margin-bottom: 14px}
.brand .logo{
  width:64px; height:64px; border-radius: 22px;
  margin: 0 auto 10px;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, rgba(110,231,255,.95), rgba(255,79,216,.75));
  color:#081022;
  box-shadow: var(--shadow);
  font-size:1.7rem;
}
.brand h1{margin:0 0 4px}
.brand p{margin:0; color:var(--muted)}
.card{
  width:min(520px, 100%);
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.05);
  box-shadow: var(--shadow);
  padding: 16px;
}
.page-card{width:100%}
.card h2{margin:0 0 10px}
.card label{display:block; margin: 12px 0 6px; color: var(--muted); font-weight:700}
.card input, .card textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.20);
  color: var(--text);
  outline:none;
}
.card textarea{min-height:110px; resize:vertical}
.row{display:flex; gap:10px; margin-top: 12px; flex-wrap:wrap}

.alert{
  border:1px solid rgba(251,191,36,.25);
  background: rgba(251,191,36,.12);
  padding: 10px 12px;
  border-radius: 14px;
  color: #ffe7b0;
  margin-bottom: 10px;
}
.alert.ok{
  border-color: rgba(74,222,128,.25);
  background: rgba(74,222,128,.12);
  color: #d6ffe6;
}
.hint{margin-top: 12px; color:var(--muted); font-size:.92rem}
.sep{border:none; border-top:1px solid var(--line); margin: 16px 0}

ul.simple{margin: 8px 0 0; padding-left: 18px; color: var(--muted)}
ul.simple li{margin: 6px 0}

.fab{
  position: fixed;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: 56px; height: 56px;
  border-radius: 20px;
  border: none;
  background: linear-gradient(135deg, rgba(110,231,255,.95), rgba(255,79,216,.75));
  box-shadow: var(--shadow);
  color:#081022;
  font-size:1.25rem;
  cursor:pointer;
  z-index: 30;
}

.modal-backdrop{
  position: fixed; inset:0;
  background: rgba(0,0,0,.55);
  z-index: 40;
}
.chat-sheet{
  position: fixed;
  left:0; right:0;
  bottom:0;
  z-index: 50;
  background: rgba(12,18,38,.95);
  border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow);
  max-height: 82vh;
  display:flex; flex-direction:column;
  overflow:hidden;
}
.chat-head{
  padding: 12px 14px;
  display:flex; align-items:center; justify-content:space-between;
  border-bottom:1px solid var(--line);
}
.chat-title{font-weight:900; display:flex; align-items:center; gap:10px}
.chat-actions{display:flex; gap:8px}
.chat-body{
  padding: 14px;
  overflow:auto;
  display:flex; flex-direction:column; gap:10px;
}
.bubble{
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  line-height:1.35;
}
.bubble.me{
  margin-left:auto;
  background: rgba(110,231,255,.12);
  border-color: rgba(110,231,255,.22);
}
.bubble.ai{
  margin-right:auto;
}
.chat-input{
  display:flex; gap:10px;
  padding: 12px 14px;
  border-top:1px solid var(--line);
}
.chat-input input{
  flex:1;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.22);
  color: var(--text);
}
.chat-hint{
  padding: 0 14px 14px;
  color: var(--muted);
  font-size:.85rem;
}

@media (min-width: 860px){
  .hero h1{font-size:1.45rem}
  .container{padding-bottom: 28px}
  .fab{right: 22px}
  .chat-sheet{left:auto; right: 22px; width: 420px; border-radius: 22px}
}
