:root{
  --fs: 15px;
  --accent: #2E6BE6;
  --accent-deep: #1B4FBF;
  --accent-soft: #EAF1FE;
  --accent-line: #BFD4F7;
  --text: #17191C;
  --text2: #5A6069;
  --text3: #9AA1AB;
  --line: rgba(16,24,40,.09);
  --panel: #FFFFFF;
  --page: #E9EDF2;
  --bg-app: #EEF3F9;
  --card-shadow: 0 1px 2px rgba(16,24,40,.045), 0 8px 24px -12px rgba(16,24,40,.12);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
*{ box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin:0; height:100%; }
body{
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs);
  line-height: 1.6;
  color: var(--text);
  background: var(--page);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button{ font-family: inherit; font-size: inherit; color: inherit; }
input, textarea{ font-family: inherit; font-size: var(--fs); color: var(--text); }
input:focus, textarea:focus{ outline: none; }

#app{
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background-color: var(--bg-app);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
@media (min-width: 520px){
  body{ display:flex; align-items:center; justify-content:center; background:#E9EDF2; }
  #app{ height: min(880px, 94vh); border-radius: 26px; border: 1px solid rgba(0,0,0,.09); }
}

/* ---------- demo bar ---------- */
.demobar{
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  margin: 0 10px 2px;
  padding: 7px 10px;
  background: #FFF6E5;
  border: .5px solid #F2DFB8;
  border-radius: 10px;
  font-size: 11.5px; color: #8A6414;
}
.demobar[hidden]{ display: none; }
.demobar span{ flex: 1; }
.demobar button{
  border: .5px solid #E4CB9B; background: #fff; color: #8A6414;
  border-radius: 8px; padding: 3px 8px; font-size: 11px; cursor: pointer;
}

/* ---------- top bar ---------- */
.topbar{
  display: flex; align-items: center; gap: 9px;
  padding: calc(12px + var(--safe-t)) 10px 9px;
  flex: 0 0 auto;
  border-bottom: .5px solid rgba(16,24,40,.055);
}
.icon-btn{
  width: 32px; height: 32px; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text);
  border-radius: 10px; cursor: pointer; padding: 0;
}
.icon-btn:active{ background: rgba(0,0,0,.06); }
.icon-btn svg{ display:block; }
.avatar{
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  background: #22262B; color: #FFFFFF;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 500;
  letter-spacing: .02em;
}
.titlebox{ flex: 1 1 auto; min-width: 0; }
.titlebox .title{
  font-size: 14px; font-weight: 500; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.titlebox .subtitle{
  font-size: 11px; color: var(--text2); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icon-btn.on{ color: var(--accent); }

/* ---------- messages ---------- */
.messages{
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 16px 6px;
  display: flex; flex-direction: column;
}
.msg{ display: flex; margin-bottom: 16px; }
.msg.user{ justify-content: flex-end; }
.msg.ai{ justify-content: flex-start; }
.bubble{
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: var(--fs);
  line-height: 1.65;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.msg.user .bubble{
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 1px 2px rgba(46,107,230,.18);
}
.msg.ai .bubble{
  background: rgba(255,255,255,.97);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  color: var(--text);
  border-bottom-left-radius: 6px;
  border: .5px solid rgba(16,24,40,.07);
  box-shadow: var(--card-shadow);
}
.msg-model{
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--text3);
  margin: 0 0 6px 3px;
  letter-spacing: .02em;
}
.msg-model::before{
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent-line);
}
.msg-body{ max-width: 88%; min-width: 0; }

.bubble p{ margin: 0 0 8px; }
.bubble > *:first-child{ margin-top: 0; }
.bubble > *:last-child{ margin-bottom: 0; }
.bubble h2, .bubble h3, .bubble h4{ margin: 12px 0 6px; font-size: 1.01em; font-weight: 600; letter-spacing: .01em; }
.bubble ul, .bubble ol{ margin: 6px 0; padding-left: 20px; }
.bubble li{ margin: 3px 0; }
.bubble code{
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88em;
  background: rgba(0,0,0,.055);
  padding: 1px 4px; border-radius: 4px;
}
.bubble pre{
  margin: 9px 0; padding: 9px 10px;
  background: #23262B; color: #E9EAEC;
  border-radius: 10px;
  white-space: pre-wrap; word-break: break-word;
  font-size: 11.5px; line-height: 1.55;
}
.bubble pre code{ background: transparent; padding: 0; color: inherit; font-size: inherit; line-height: inherit; }
.bubble blockquote{
  margin: 8px 0; padding-left: 9px;
  border-left: 2px solid var(--accent-line); color: var(--text2);
}
.bubble a{ color: var(--accent-deep); }

.bubble img{ max-width: 100%; border-radius: 8px; display: block; margin: 4px 0; }
.msg.user .bubble img{ margin: 2px 0; }

.msg-actions{
  display: flex; gap: 14px;
  font-size: 11.5px; color: var(--text3);
  margin: 8px 0 0 6px;
}
.msg-actions button{
  border: 0; background: transparent; padding: 0; color: inherit;
  font-size: 11.5px; cursor: pointer;
}
.msg-actions button:active{ opacity: .5; }

.reasoning{
  margin: 0 0 9px 2px;
  font-size: 12.5px;
  color: var(--text2);
}
.reasoning summary{
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; color: var(--text3); font-size: 12px;
  list-style: none; padding: 2px 0;
}
.reasoning summary::-webkit-details-marker{ display: none; }
.reasoning summary::before{
  content: ""; width: 0; height: 0;
  border-left: 4.5px solid currentColor;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  transition: transform .16s;
}
.reasoning[open] summary::before{ transform: rotate(90deg); }
.reasoning .rc{
  margin-top: 8px; padding-left: 11px;
  border-left: 2px solid var(--accent-line);
  white-space: pre-wrap; line-height: 1.66;
  max-height: 220px; overflow-y: auto;
  color: var(--text2);
}

.bubble li.task{ list-style: none; margin-left: -16px; display: flex; gap: 8px; align-items: flex-start; }
.bubble li.task .box{
  width: 13px; height: 13px; flex: 0 0 auto; margin-top: 4px;
  border: 1.3px solid var(--accent-line); border-radius: 4px;
}
.bubble li.task.done{ color: var(--text3); text-decoration: line-through; }
.bubble li.task.done .box{ background: var(--accent); border-color: var(--accent); }
.msg.user .bubble li.task .box{ border-color: rgba(255,255,255,.65); }
.msg.user .bubble li.task.done .box{ background: rgba(255,255,255,.9); }

.cursor{
  display: inline-block; width: 2px; height: 1em;
  background: var(--accent); vertical-align: -2px;
  animation: blink .9s steps(2) infinite;
}
@keyframes blink{ 50%{ opacity: 0 } }

.dots{ display: inline-flex; gap: 4px; padding: 3px 2px; }
.dots i{
  width: 5px; height: 5px; border-radius: 50%; background: #A8B0BB;
  display: block; animation: bounce 1.2s infinite;
}
.dots i:nth-child(2){ animation-delay: .15s; background: #BEC5CE; }
.dots i:nth-child(3){ animation-delay: .3s; background: #D2D7DE; }
@keyframes bounce{ 0%,60%,100%{ transform: translateY(0); opacity:.5 } 30%{ transform: translateY(-4px); opacity:1 } }

.empty{
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 9px; color: var(--text2);
  padding: 20px 14px 56px; text-align: center;
}
.empty .mark{
  width: 44px; height: 44px; border-radius: 15px;
  background: #22262B; color: #fff;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 500; letter-spacing: .04em;
  margin-bottom: 6px;
  box-shadow: 0 6px 16px -8px rgba(16,24,40,.4);
}
.empty .big{ font-size: 15.5px; font-weight: 600; color: var(--text); }
.empty .small{ font-size: 12.5px; color: var(--text2); line-height: 1.75; }
.empty .tip{ font-size: 11px; color: var(--text3); margin-top: 8px; }

/* ---------- composer ---------- */
.composer-wrap{
  flex: 0 0 auto;
  padding: 4px 10px calc(12px + var(--safe-b));
}
.composer{
  background: rgba(255,255,255,.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 10px 12px 8px;
  border: .5px solid rgba(16,24,40,.07);
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 18px -10px rgba(16,24,40,.16);
}
#input{
  width: 100%; border: 0; resize: none; background: transparent;
  line-height: 1.5; max-height: 132px; padding: 3px 1px;
  display: block;
}
#input::placeholder{ color: var(--text3); }
.iconrow{
  display: flex; align-items: center; gap: 11px;
  margin-top: 5px;
}
.grow{ flex: 1 1 auto; }
.model-chip{
  display: inline-flex; align-items: center; gap: 5px;
  height: 27px; padding: 0 8px 0 6px;
  border: .5px solid var(--accent-line);
  background: #F4F9FF; color: var(--accent-deep);
  border-radius: 14px;
  font-size: 11.5px;
  max-width: 168px;
  cursor: pointer;
  flex: 0 0 auto;
}
.model-chip .chip-dot{
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); flex: 0 0 auto;
}
.model-chip .chip-text{
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.model-chip .chip-caret{ flex: 0 0 auto; }
.iconrow .icon-btn{ width: 26px; height: 26px; color: var(--text2); }
.iconrow .icon-btn.reason.on{
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 8px;
}
.send-btn{
  width: 30px; height: 30px; border-radius: 15px;
  background: var(--accent); color: #fff;
  border: 0; display: grid; place-items: center;
  flex: 0 0 auto; cursor: pointer;
  transition: background .16s;
}
.send-btn.idle{ background: #A9C9E8; }
.send-btn.stop{ background: #E24B4A; }

.attach-strip{ display: flex; gap: 6px; padding: 0 2px 7px; flex-wrap: wrap; }
.attach-thumb{
  position: relative; width: 46px; height: 46px;
  border-radius: 9px; overflow: hidden;
  border: .5px solid rgba(0,0,0,.1); background: #fff;
}
.attach-thumb img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-thumb .x{
  position: absolute; top: 1px; right: 1px;
  width: 15px; height: 15px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff;
  border: 0; font-size: 10px; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
}

/* ---------- scrim / drawer / sheet / page ---------- */
.scrim{
  position: absolute; inset: 0; z-index: 40;
  background: rgba(18,22,28,.30);
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
}
.scrim.on{ opacity: 1; pointer-events: auto; }

.drawer{
  position: absolute; top: 0; bottom: 0; left: 0; z-index: 50;
  width: 84%; max-width: 330px;
  background: var(--panel);
  border-radius: 0 18px 18px 0;
  transform: translateX(-102%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
  display: flex; flex-direction: column;
  padding-top: var(--safe-t);
}
.drawer.on{ transform: none; }
.drawer-head{
  display: flex; align-items: center; padding: 8px 10px 4px 16px;
}
.drawer-title{ flex: 1; font-size: 15px; font-weight: 500; }
.searchbox{
  display: flex; align-items: center; gap: 7px;
  margin: 6px 12px 8px;
  height: 34px; padding: 0 11px;
  background: #F1F3F6; border-radius: 17px;
  color: var(--text3);
  flex: 0 0 auto;
}
.searchbox input{
  flex: 1; border: 0; background: transparent; font-size: 13px;
}
.drawer-list{ flex: 1; overflow-y: auto; padding: 0 8px; }
.conv-item{
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
}
.conv-item.on{ background: #F4F9FF; }
.conv-item .row1{ display: flex; align-items: center; gap: 6px; }
.conv-item .ct{
  flex: 1; font-size: 13px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-item .cd{ font-size: 11px; color: var(--text3); flex: 0 0 auto; }
.conv-item .cp{
  font-size: 11px; color: var(--text2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-item .pinmark{ color: var(--accent); font-size: 11px; }
.drawer-foot{
  flex: 0 0 auto; border-top: .5px solid var(--line);
  padding: 6px 10px calc(10px + var(--safe-b));
}
.row-btn{
  width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 8px; font-size: 13px; border-radius: 8px; cursor: pointer;
}
.row-btn:active{ background: #F1F3F6; }

.sheet{
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 55;
  background: var(--panel);
  border-radius: 20px 20px 0 0;
  transform: translateY(102%);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
  display: flex; flex-direction: column;
  max-height: 84%;
  padding-bottom: var(--safe-b);
}
.sheet.on{ transform: none; }
.grabber{
  width: 36px; height: 4px; border-radius: 2px;
  background: #D6DAE0; margin: 8px auto 6px; flex: 0 0 auto;
}
.sheet-body{ overflow-y: auto; padding: 0 12px; flex: 1 1 auto; }
.sheet-foot{ flex: 0 0 auto; border-top: .5px solid var(--line); padding: 4px 10px 8px; }
.sheet-title{
  font-size: 12px; color: var(--text3); padding: 10px 4px 4px;
}

.page{
  position: absolute; inset: 0; z-index: 60;
  background: var(--panel);
  transform: translateX(100%);
  transition: transform .26s cubic-bezier(.32,.72,0,1);
  display: flex; flex-direction: column;
  padding-top: var(--safe-t);
}
.page.on{ transform: none; }
.page-head{
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px 8px;
  border-bottom: .5px solid var(--line);
  flex: 0 0 auto;
}
.page-title{ flex: 1; font-size: 15px; font-weight: 500; }
.text-btn{
  border: 0; background: transparent; color: var(--accent-deep);
  font-size: 13px; padding: 7px 6px; cursor: pointer;
}
.text-btn.danger{ color: #A32D2D; }
.page-body{ flex: 1; overflow-y: auto; padding: 12px 14px calc(20px + var(--safe-b)); }
.page-body.form{ display: flex; flex-direction: column; gap: 10px; }

/* ---------- model sheet ---------- */
.model-search{
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; margin: 4px 0 2px;
  background: #F1F3F6; border-radius: 12px; color: var(--text3);
}
.model-search input{ flex: 1; border: 0; background: transparent; font-size: 13px; }
.mrow{
  display: flex; align-items: center; gap: 9px;
  padding: 8px; border-radius: 10px; cursor: pointer;
}
.mrow.on{ background: #F4F9FF; }
.mrow .mdot{
  width: 22px; height: 22px; border-radius: 11px; flex: 0 0 auto;
}
.mrow .mbody{ flex: 1; min-width: 0; }
.mrow .mname{
  font-size: 12.5px; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mrow .mmeta{
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text3); margin-top: 2px;
  overflow: hidden;
}
.mrow .mmeta .tag{
  color: var(--accent-deep); border: .5px solid var(--accent-line);
  border-radius: 4px; padding: 0 3px; line-height: 1.45; flex: 0 0 auto;
}
.mrow .mmeta .tag.vis{
  color: #1D8A6E; border-color: #BCE3D5; background: rgba(52,160,91,.08);
}
.mrow .fav{
  border: 0; background: transparent; padding: 2px; color: #C3C8CF;
  cursor: pointer; flex: 0 0 auto;
}
.mrow .fav.on{ color: var(--accent); }
.chips-scroll{
  display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px 6px;
  border-top: .5px solid var(--line); margin-top: 6px;
}
.chips-scroll::-webkit-scrollbar{ display: none; }
.fchip{
  height: 26px; padding: 0 11px; border-radius: 13px;
  background: #F1F3F6; color: var(--text2);
  display: inline-flex; align-items: center;
  font-size: 11.5px; white-space: nowrap;
  border: 0; cursor: pointer; flex: 0 0 auto;
}
.fchip.on{ background: var(--accent-soft); color: var(--accent-deep); }

/* ---------- provider cards ---------- */
.pcard{
  border: .5px solid rgba(0,0,0,.09); border-radius: 14px;
  padding: 11px 12px; margin-bottom: 10px;
  background: #fff; cursor: pointer;
}
.pcard.on{ border-color: var(--accent-line); background: #F8FBFF; }
.pcard .prow{ display: flex; align-items: center; gap: 7px; }
.pcard .pdot{
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
}
.pcard .pname{ font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .badge{
  font-size: 10.5px; color: var(--accent-deep); background: var(--accent-soft);
  border-radius: 4px; padding: 1px 5px; flex: 0 0 auto;
}
.pcard .purl{
  font-size: 11px; color: var(--text2); margin-top: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pcard .pfoot{
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px; font-size: 11px; color: var(--text3);
}
.add-card{
  border: .5px dashed rgba(0,0,0,.22); border-radius: 14px;
  padding: 14px; display: flex; align-items: center; justify-content: center;
  gap: 6px; color: var(--text2); font-size: 12.5px; cursor: pointer;
}

/* ---------- forms ---------- */
.field-label{ font-size: 11.5px; color: var(--text2); padding-left: 2px; }
.field{
  width: 100%; border: .5px solid rgba(0,0,0,.12);
  border-radius: 11px; padding: 10px 12px;
  background: #fff; font-size: 14px;
}
.field.area{ min-height: 90px; resize: vertical; line-height: 1.55; }
.hint{ font-size: 11px; color: var(--text3); line-height: 1.6; padding-left: 2px; }
.buildtag{
  font-size: 10.5px; color: var(--text3);
  text-align: center; padding: 6px 0 2px; letter-spacing: .04em;
}
.testresult{
  font-size: 12px; line-height: 1.6;
  padding: 9px 11px; border-radius: 10px;
  white-space: pre-wrap;
}
.testresult[hidden]{ display: none; }
.testresult.ok{ background: #E9F6EF; color: #17603F; border: .5px solid #BFE3D1; }
.testresult.bad{ background: #FDECEC; color: #8E2626; border: .5px solid #F3C9C9; }
.testresult.wait{ background: #F1F3F6; color: var(--text2); border: .5px solid var(--line); }
.switch-row{
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 2px; border-bottom: .5px solid var(--line);
  font-size: 14px;
}
.switch-row:last-child{ border-bottom: 0; }
.switch{
  width: 44px; height: 26px; border-radius: 13px;
  background: #D6DAE0; position: relative; border: 0;
  cursor: pointer; flex: 0 0 auto; transition: background .18s;
}
.switch::after{
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  transition: transform .18s;
}
.switch.on{ background: var(--accent); }
.switch.on::after{ transform: translateX(18px); }
.color-row{ display: flex; gap: 8px; padding: 8px 2px 2px; flex-wrap: wrap; }
.color-dot{
  width: 26px; height: 26px; border-radius: 50%;
  border: .5px solid rgba(0,0,0,.12); cursor: pointer;
}
.color-dot.on{ box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--accent); }
.menu-item{
  display: flex; align-items: center; gap: 10px;
  padding: 13px 4px; font-size: 14px;
  border: 0; border-bottom: .5px solid var(--line);
  background: transparent; width: 100%; text-align: left; cursor: pointer;
}
.menu-item:active{ background: #F1F3F6; }
.menu-item.danger{ color: #A32D2D; }
.mi-label{ flex: 1; min-width: 0; }
.mi-note{ font-size: 11.5px; color: var(--text3); flex: 0 0 auto; }
.sheet-head{
  font-size: 14px; font-weight: 500; color: var(--text);
  padding: 6px 4px 10px;
}

/* ---------- settings groups ---------- */
.gtitle{
  font-size: 11.5px; color: var(--text3);
  letter-spacing: .03em; padding: 2px 4px 7px;
}
.gcard{
  background: #fff;
  border: .5px solid rgba(16,24,40,.08);
  border-radius: 14px;
  padding: 12px 12px 13px;
  margin-bottom: 18px;
}
.gline{
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13.5px; color: var(--text);
}
.gline .gval{ font-size: 12px; color: var(--text3); }
.gsep{ height: .5px; background: var(--line); margin: 11px 0; }
.grow-btn{
  width: 100%; text-align: left; border: 0; background: transparent;
  padding: 10px 2px; font-size: 13.5px; border-radius: 8px; cursor: pointer;
  color: var(--text);
}
.grow-btn:active{ background: #F1F3F6; }
.grow-btn.danger{ color: #A32D2D; }
.gbtns{ display: flex; gap: 8px; margin-top: 11px; }
.gbtn{
  flex: 1; height: 34px;
  border: .5px solid rgba(16,24,40,.12); background: #fff;
  border-radius: 10px; font-size: 12.5px; cursor: pointer;
}
.gbtn:active{ background: #F1F3F6; }
input[type=range]{
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; margin: 9px 0 3px;
  border-radius: 2px; background: #E1E6EC;
}
input[type=range]::-webkit-slider-thumb{
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: .5px solid rgba(16,24,40,.16);
  box-shadow: 0 1px 3px rgba(16,24,40,.24);
}

/* ---------- toast ---------- */
.toast{
  position: absolute; left: 50%; bottom: 112px; z-index: 90;
  transform: translateX(-50%) translateY(8px);
  background: rgba(30,34,40,.9); color: #fff;
  font-size: 12.5px; padding: 8px 14px; border-radius: 12px;
  opacity: 0; pointer-events: none; transition: .22s;
  max-width: 86%; text-align: center;
}
.toast.on{ opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 生活板块（纪念日 / 经期） ---------- */
.ltabs{ display:flex; gap:8px; padding:2px 0 14px; }
.ltab{
  flex:1; text-align:center; padding:9px 0; border-radius:12px; border:0;
  background:#F1F3F6; color:#5B6470; font-size:13.5px; cursor:pointer;
  transition:background .15s, color .15s;
}
.ltab.on{ background:#2E6BE6; color:#fff; font-weight:500; }

.ev-card{
  display:flex; align-items:center; gap:10px;
  background:#fff; border:1px solid rgba(0,0,0,.055); border-radius:14px;
  padding:13px 14px; margin-bottom:9px; cursor:pointer;
}
.ev-card .ev-name{ font-size:14px; font-weight:600; flex:1; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ev-card .ev-date{ font-size:11px; color:#8B95A1; white-space:nowrap; }
.ev-card .ev-dd{ font-size:13px; font-weight:600; color:#5B6470; white-space:nowrap; }
.ev-card.soon .ev-dd{ color:#D96A00; }
.ev-card.now{ border-color:#F2C063; background:#FFF8EC; }
.ev-card.now .ev-dd{ color:#C77F00; }

.pd-card{
  background:#fff; border:1px solid rgba(0,0,0,.055); border-radius:16px;
  padding:20px 16px; text-align:center; margin-bottom:12px;
}
.pd-card .pd-big{ font-size:18px; font-weight:700; letter-spacing:.01em; }
.pd-card .pd-sub{ font-size:12px; color:#8B95A1; margin-top:6px; }
.pd-stats{ font-size:11px; color:#8B95A1; text-align:center; margin-bottom:6px; }

.pd-row{
  display:flex; align-items:center; gap:10px;
  background:#fff; border:1px solid rgba(0,0,0,.055); border-radius:12px;
  padding:10px 12px; margin-bottom:7px; font-size:13px;
}
.pd-row .pd-d{ color:#1F2328; flex:1; font-variant-numeric:tabular-nums; }
.pd-row .pd-len{ color:#8B95A1; font-size:12px; white-space:nowrap; }
.pd-row .pd-del{ border:0; background:transparent; color:#B4552D; font-size:12px; cursor:pointer; padding:4px 6px; }

/* ---------- 表情包 ---------- */
/* 消息里的表情图 */
.bubble img.sticker{
  width: 96px; height: 96px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  margin: 2px 0;
}

/* 表情面板头部 */
.stk-head{
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 0 10px;
}
.stk-head .sheet-head{ padding: 0; flex: 1; }
.stk-edit-btn{
  border: 0; background: transparent; cursor: pointer;
  font-size: 13px; color: #5B6470; padding: 5px 8px; border-radius: 8px;
}
.stk-edit-btn.on{ background: #2E6BE6; color: #fff; }

/* 表格网格：一行 4 个 */
.stk-grid{
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px 10px; padding: 2px 0 6px;
}
.stk{
  border: 0; background: transparent; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  position: relative;
}
.stk img{
  width: 100%; aspect-ratio: 1; height: auto;
  object-fit: cover; border-radius: 12px;
  border: .5px solid rgba(0,0,0,.05);
  background: #F1F3F6;
  transition: transform .12s;
}
.stk:active img{ transform: scale(.92); }
.stk-name{
  font-size: 11px; color: #5B6470;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stk-x{
  position: absolute; top: -6px; right: -6px; z-index: 2;
  width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: #D9503F; color: #fff; font-size: 13px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.stk-add{
  border: 1px dashed #C3C8CF; border-radius: 12px;
  background: transparent; cursor: pointer;
  aspect-ratio: 1; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.stk-add .stk-plus{ font-size: 22px; color: #8B95A1; line-height: 1; }
.stk-add .stk-name{ color: #8B95A1; }

/* 纯表情消息：不要气泡底色，图自己靠右 */
.msg.user .bubble.plain{
  background: transparent;
  padding: 0;
  box-shadow: none;
  border: 0;
}
.msg.user .bubble.plain img.sticker{
  width: 110px; height: 110px;
  border-radius: 16px;
}
