:root {
  --bg: #f6f6f3;
  --card: #ffffff;
  --text: #1c1c1a;
  --sub: #6b6b66;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);
  --accent: #185fa5;
  --accent-soft: #e6f1fb;
  --ok: #1d9e75;
  --warn: #ba7517;
  --err: #a32d2d;
  --radius: 14px;
  --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%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* 电脑上预览时收成手机宽度，居中显示；手机上全屏不受影响 */
@media (min-width: 720px) {
  body {
    background: #e6e6e1;
    display: flex;
    justify-content: center;
    align-items: stretch;
  }
  #app {
    width: 420px;
    flex: 0 0 420px;
    background: var(--bg);
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1);
  }
  .toast {
    position: absolute;
  }
}

/* ---------- 顶栏 ---------- */
#topbar {
  flex: 0 0 auto;
  height: calc(52px + var(--safe-t));
  padding: var(--safe-t) 8px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 0.5px solid var(--line);
  z-index: 20;
}
.tb-left,
.tb-right {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
#title {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62vw;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background 0.15s;
}
.icon-btn:active {
  background: rgba(0, 0, 0, 0.06);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c8c8c2;
  margin-right: 4px;
  transition: background 0.25s;
}
.dot.on {
  background: var(--ok);
}
.dot.wait {
  background: var(--warn);
}

/* ---------- 工作区条 ---------- */
.ws-bar {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 0.5px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.ws-bar::-webkit-scrollbar {
  display: none;
}
.ws-chip {
  flex: 0 0 auto;
  border: 0.5px solid var(--line-strong);
  background: var(--card);
  color: var(--sub);
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ws-chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.ws-chip .lock {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.55;
}

/* 只读工作区的输入区 */
.composer.readonly {
  opacity: 0.75;
}
.readonly-tip {
  font-size: 12px;
  color: var(--sub);
  padding: 2px 4px 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ---------- 视图容器 ---------- */
#views {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
}
.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  min-height: 0;
}
.view.active {
  display: flex;
}

/* ---------- 列表 ---------- */
.list {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px 12px calc(88px + var(--safe-b));
  contain: content;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 0.5px solid var(--line);
  transition: transform 0.12s ease, background 0.12s;
}
.card:active {
  transform: scale(0.994);
  background: #fafaf8;
}
.card-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.card-title {
  flex: 1 1 auto;
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-time {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--sub);
}
.card-preview {
  margin-top: 4px;
  font-size: 13px;
  color: var(--sub);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-right: 6px;
  vertical-align: 1px;
}
.tag.plain {
  background: rgba(0, 0, 0, 0.05);
  color: var(--sub);
}

.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--sub);
  gap: 6px;
}
.hint {
  color: var(--sub);
  font-size: 13px;
}
.tiny {
  font-size: 12px;
  opacity: 0.85;
}

/* ---------- 消息 ---------- */
.messages {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 12px 8px;
  scroll-behavior: smooth;
}
.msg {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}
.msg.user {
  align-items: flex-end;
}
.bubble {
  max-width: 86%;
  border-radius: 16px;
  padding: 9px 13px;
  font-size: 15px;
  word-break: break-word;
  overflow-wrap: break-word;
}
.msg.user .bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.msg.assistant .bubble {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-bottom-left-radius: 6px;
  max-width: 94%;
  padding: 12px 14px;
}
.bubble p {
  margin: 0 0 10px;
}
.bubble p:last-child {
  margin-bottom: 0;
}
.bubble pre {
  background: #f4f4f0;
  border: 0.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.55;
  margin: 10px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.bubble code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.bubble pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}
.bubble img {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  margin-top: 6px;
}
.bubble ul,
.bubble ol {
  margin: 8px 0 10px;
  padding-left: 21px;
}
.bubble li {
  margin-bottom: 5px;
}
.bubble li:last-child {
  margin-bottom: 0;
}
.bubble strong {
  font-weight: 600;
  color: #0f0f0e;
}
.bubble h1,
.bubble h2,
.bubble h3,
.bubble h4 {
  font-weight: 600;
  line-height: 1.4;
  color: #12120f;
}
.bubble h1 {
  font-size: 18.5px;
  margin: 18px 0 9px;
}
.bubble h2 {
  font-size: 16.5px;
  margin: 16px 0 8px;
  padding-top: 10px;
  border-top: 0.5px solid var(--line);
}
.bubble h3 {
  font-size: 15.5px;
  margin: 13px 0 6px;
}
.bubble h4 {
  font-size: 15px;
  margin: 10px 0 5px;
}
.bubble > h1:first-child,
.bubble > h2:first-child,
.bubble > h3:first-child,
.bubble > p:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.msg-meta {
  font-size: 11px;
  color: var(--sub);
  margin-top: 4px;
  padding: 0 4px;
}

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

.thought {
  max-width: 86%;
  font-size: 13px;
  color: var(--sub);
  background: rgba(0, 0, 0, 0.035);
  border-radius: 12px;
  padding: 6px 12px;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.tool {
  max-width: 92%;
  font-size: 12.5px;
  color: var(--sub);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--card);
  border: 0.5px solid var(--line);
  margin-bottom: 6px;
  overflow: hidden;
}
.tool .tname {
  color: var(--accent);
  font-weight: 500;
}
.tool .targ {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool.done .tdot {
  background: var(--ok);
}
.tdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
  flex: 0 0 auto;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

/* 闸门快照（自检清单）：默认收成一行 */
.gate-block {
  max-width: 92%;
  width: 100%;
}
.gate-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 0.5px dashed var(--line-strong);
  background: rgba(0, 0, 0, 0.018);
  color: var(--sub);
  font-size: 12px;
  font-family: inherit;
  padding: 6px 11px;
  border-radius: 10px;
  text-align: left;
}
.gate-block.open .tg-arrow {
  transform: rotate(90deg);
}
.gate-body {
  margin-top: 4px;
  padding: 10px 12px;
  border-left: 2px solid var(--line);
  margin-left: 6px;
  font-size: 12.5px;
  color: var(--sub);
  line-height: 1.6;
}
.gate-body p {
  margin: 0 0 8px;
}
.gate-body p:last-child {
  margin-bottom: 0;
}
.gate-body ul,
.gate-body ol {
  margin: 0;
  padding-left: 18px;
}

/* ---------- 移动端 Markdown 适配 ---------- */

/* 表格：外面套一层横向滚动，列宽按内容，绝不压缩成竖条 */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 10px 0;
  max-width: 100%;
}
.table-scroll table {
  margin: 0;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.55;
}
.table-scroll th,
.table-scroll td {
  border: 0.5px solid var(--line-strong);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
  min-width: 3.5em;
  overflow-wrap: break-word;
  word-break: normal;
}
.table-scroll th {
  background: #f7f7f4;
  font-weight: 600;
  white-space: nowrap;
}
.table-scroll tr:first-child td {
  background: #f7f7f4;
  font-weight: 600;
}

/* 链接、分隔线、引用 */
.bubble a,
.doc a {
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: break-word;
}
.bubble hr,
.doc hr {
  border: 0;
  border-top: 0.5px solid var(--line);
  margin: 16px 0;
}
.bubble blockquote,
.doc blockquote {
  margin: 10px 0;
  padding: 4px 12px;
  border-left: 3px solid var(--accent-soft);
  color: var(--sub);
}
.bubble blockquote p:last-child,
.doc blockquote p:last-child {
  margin-bottom: 0;
}

/* 很长的代码行不撑破气泡 */
.bubble pre {
  max-width: 100%;
}
.doc pre {
  max-width: 100%;
}

/* 有序/无序列表缩进，避免贴边 */
.bubble ul ul,
.bubble ol ol,
.bubble ul ol,
.bubble ol ul,
.doc ul ul,
.doc ol ol {
  margin: 4px 0 4px;
}

/* 长内容折叠按钮 */
.expand-btn {
  display: inline-block;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12.5px;
  font-family: inherit;
  padding: 3px 4px;
  margin: -2px 0 8px;
}
.more-btn {
  display: block;
  margin: 0 auto 10px;
}
.expand-btn:active {
  opacity: 0.6;
}

/* ---------- 用量页 ---------- */
.usage {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 12px calc(24px + var(--safe-b));
}
.usage-hero {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}
.uh-label {
  font-size: 12.5px;
  color: var(--sub);
}
.uh-value {
  font-size: 32px;
  font-weight: 500;
  color: var(--text);
  margin: 6px 0 2px;
  letter-spacing: -0.5px;
}
.uh-sub {
  font-size: 12px;
  color: var(--sub);
}
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.metric {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.m-label {
  font-size: 12px;
  color: var(--sub);
}
.m-value {
  font-size: 19px;
  font-weight: 500;
  margin-top: 3px;
}
.m-note {
  font-size: 11px;
  color: var(--sub);
  margin-top: 2px;
}
.usage-sec {
  font-size: 13px;
  font-weight: 500;
  color: var(--sub);
  margin: 20px 2px 8px;
}
.usage-list {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.usage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 0.5px solid var(--line);
}
.usage-row:last-child {
  border-bottom: 0;
}
.ur-left {
  flex: 1 1 auto;
  min-width: 0;
}
.ur-title {
  font-size: 13.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ur-sub {
  font-size: 11.5px;
  color: var(--sub);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ur-cost {
  font-size: 13.5px;
  font-weight: 500;
  flex: 0 0 auto;
  color: var(--text);
}
.ur-cost.bad {
  color: var(--err);
}

/* ---------- 工具调用折叠组 ---------- */
.tgroup {
  margin-bottom: 10px;
  max-width: 92%;
}
.tg-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--sub);
  padding: 5px 11px;
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 10px;
  line-height: 1.4;
}
.tg-head:active {
  background: #f7f7f4;
}
.tg-arrow {
  width: 0;
  height: 0;
  border-left: 4px solid var(--sub);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  flex: 0 0 auto;
  transition: transform 0.15s;
}
.tgroup.open .tg-arrow {
  transform: rotate(90deg);
}
.tg-count {
  color: var(--text);
  font-weight: 500;
}
.tg-names {
  color: var(--sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-body {
  margin-top: 4px;
  padding-left: 8px;
  border-left: 1.5px solid var(--line);
  margin-left: 6px;
}
.tg-body .tool {
  max-width: 100%;
  font-size: 11.5px;
  padding: 3px 8px;
  margin-bottom: 3px;
  background: #fafaf8;
}
.tg-body .tool .tdot {
  animation: none;
}

.sysnote {
  font-size: 12px;
  color: var(--sub);
  text-align: center;
  margin: 10px 0;
}

/* ---------- 输入区 ---------- */
.composer {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 0.5px solid var(--line);
  padding: 8px 10px calc(8px + var(--safe-b));
}
.input-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
#input {
  flex: 1;
  border: 0.5px solid var(--line-strong);
  background: var(--bg);
  border-radius: 18px;
  padding: 9px 14px;
  font-size: 15px;
  line-height: 1.4;
  max-height: 120px;
  resize: none;
  outline: none;
  font-family: inherit;
  color: var(--text);
}
#input:focus {
  border-color: var(--accent);
  background: #fff;
}
.send-btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 18px;
  font-weight: 500;
  transition: opacity 0.15s;
}
.send-btn:disabled {
  opacity: 0.35;
}
.send-btn.stop {
  background: var(--err);
}
.attach-preview {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  overflow-x: auto;
}
.attach-preview img {
  height: 56px;
  border-radius: 8px;
  border: 0.5px solid var(--line);
}
.attach-thumb {
  position: relative;
}
.attach-thumb button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: #444;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

/* ---------- 底栏 ---------- */
#tabbar {
  flex: 0 0 auto;
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 0.5px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tab {
  flex: 1;
  border: 0;
  background: none;
  color: var(--sub);
  padding: 7px 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
}
.tab.active {
  color: var(--accent);
}
.fab {
  position: absolute;
  right: 16px;
  bottom: calc(72px + var(--safe-b));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(24, 95, 165, 0.32);
  z-index: 15;
}
.fab:active {
  transform: scale(0.94);
}

/* ---------- 文件 / 文档 ---------- */
.crumb {
  flex: 0 0 auto;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--sub);
  border-bottom: 0.5px solid var(--line);
  white-space: nowrap;
  overflow-x: auto;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--card);
  border-radius: 12px;
  margin-bottom: 6px;
  border: 0.5px solid var(--line);
  font-size: 14px;
}
.file-row:active {
  background: #fafaf8;
}
.file-row .fname {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-row .fsize {
  font-size: 11.5px;
  color: var(--sub);
}
.file-row.indent {
  margin-left: 14px;
}
.doc {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px calc(40px + var(--safe-b));
  font-size: 15px;
  line-height: 1.7;
  background: var(--card);
}
.doc h1 {
  font-size: 21px;
  margin: 4px 0 14px;
}
.doc h2 {
  font-size: 17px;
  margin: 22px 0 10px;
  padding-top: 6px;
  border-top: 0.5px solid var(--line);
}
.doc h3 {
  font-size: 15.5px;
  margin: 16px 0 8px;
}
.doc p {
  margin: 0 0 12px;
}
.doc ul,
.doc ol {
  margin: 0 0 12px;
  padding-left: 22px;
}
.doc li {
  margin-bottom: 4px;
}
.doc code {
  background: rgba(0, 0, 0, 0.055);
  padding: 1.5px 5px;
  border-radius: 5px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.doc pre {
  background: #f2f2ee;
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 12.5px;
}
.doc pre code {
  background: none;
  padding: 0;
}
.doc table {
  border-collapse: collapse;
  font-size: 13px;
}
.doc th,
.doc td {
  border: 0.5px solid var(--line-strong);
  padding: 6px 9px;
  text-align: left;
}
.doc th {
  background: #f7f7f4;
  font-weight: 500;
}
.doc blockquote {
  margin: 10px 0;
  padding: 6px 12px;
  border-left: 3px solid var(--accent-soft);
  color: var(--sub);
}

/* ---------- 设置 ---------- */
.settings {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px calc(40px + var(--safe-b));
}
.field {
  display: block;
  margin-bottom: 14px;
}
.field span {
  display: block;
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 5px;
}
.field input {
  width: 100%;
  border: 0.5px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  background: var(--card);
  color: var(--text);
  outline: none;
  font-family: inherit;
}
.field input:focus {
  border-color: var(--accent);
}
.actions {
  display: flex;
  gap: 10px;
  margin: 18px 0;
}
button.primary {
  flex: 1;
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 11px;
  font-size: 15px;
  font-weight: 500;
}
button.ghost {
  flex: 1;
  border: 0.5px solid var(--line-strong);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  padding: 11px;
  font-size: 15px;
}
button.primary:active,
button.ghost:active {
  opacity: 0.8;
}
.pair textarea {
  width: 100%;
  border: 0.5px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  font-family: ui-monospace, monospace;
  margin: 6px 0 10px;
  background: var(--card);
  color: var(--text);
}
.status-box {
  margin-top: 18px;
  font-size: 13px;
  color: var(--sub);
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  white-space: pre-wrap;
  line-height: 1.7;
}
.sec-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 26px 0 0;
}

/* ---------- 杂项 ---------- */
.hidden {
  display: none !important;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(100px + var(--safe-b));
  transform: translateX(-50%) translateY(8px);
  background: rgba(28, 28, 26, 0.9);
  color: #fff;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 99;
  max-width: 80vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
