/* ===================================================================
   lioncloud.one — design foundations
   科技感 / 赛博冷感 · 温柔内容
   Leo = 暖金红 (荒九朝的蛇)  ·  Cloud = 冷蓝紫 (折射光的云)
   =================================================================== */

:root {
  /* — surfaces / void — */
  --void:        #04050b;
  --void-2:      #070a14;
  --deep:        #0a0e1c;
  --deep-2:      #10152a;

  /* — glass — */
  --glass:        rgba(255, 255, 255, 0.045);
  --glass-2:      rgba(255, 255, 255, 0.075);
  --glass-hi:     rgba(255, 255, 255, 0.13);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-edge:   rgba(255, 255, 255, 0.22);
  --blur:         22px;

  /* — text — */
  --text:        #e9edf8;
  --text-soft:   #b6bfd4;
  --text-muted:  #7e8aa6;
  --text-faint:  #525d78;

  /* — Cloud (cool / blue-violet) — */
  --cloud:       #8e9ff5;
  --cloud-2:     #a98bf5;
  --cloud-glow:  #9db4ff;
  --cloud-deep:  #4a52a8;

  /* — Leo (warm / gold-red, the snake) — */
  --leo:         #f0a868;
  --leo-2:       #e0795a;
  --leo-glow:    #ffbe85;
  --leo-deep:    #a8533a;

  /* — aurora (teal / cyan) — */
  --aurora-teal: #4fd6c2;
  --aurora-cyan: #46b6f0;
  --aurora-vio:  #8a7ff0;

  /* — morandi blue (phone desktop) — */
  --morandi:     #8b9bb8;
  --morandi-2:   #6c7e9e;
  --morandi-deep:#46566f;
  --morandi-ink: #2b3650;

  /* — fonts (system generics · 自动解析到本地字体, 无需上传) — */
  --serif: Georgia, "Times New Roman", serif;        /* @kind font */
  --sans:  system-ui, -apple-system, sans-serif;      /* @kind font */
  --mono:  ui-monospace, "SF Mono", Menlo, monospace; /* @kind font */

  /* — radii — */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  /* — shadow — */
  --shadow-soft: 0 18px 50px -18px rgba(0,0,0,0.7);
  --shadow-pop:  0 30px 80px -28px rgba(0,0,0,0.85);
  --ease:        cubic-bezier(0.22, 1, 0.36, 1); /* @kind other */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--sans);
  background: var(--void);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
#root { height: 100vh; width: 100vw; }

::selection { background: rgba(142,159,245,0.35); color: #fff; }

/* — scrollbars — */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
::-webkit-scrollbar-track { background: transparent; }

/* ===================================================================
   shared primitives
   =================================================================== */

.glass {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 0 var(--glass-edge);
}

/* mono technical label */
.tech-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

/* buttons */
.btn {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--glass-border);
  background: var(--glass-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  padding: 13px 30px;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
              border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn:hover { background: var(--glass-hi); border-color: var(--glass-edge); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-glow {
  border-color: rgba(142,159,245,0.4);
  box-shadow: 0 0 0 1px rgba(142,159,245,0.12), 0 14px 40px -16px rgba(142,159,245,0.55);
}
.btn-glow:hover {
  border-color: rgba(157,180,255,0.7);
  box-shadow: 0 0 0 1px rgba(142,159,245,0.25), 0 18px 48px -14px rgba(142,159,245,0.7);
}

/* faint divider */
.hairline {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
  border: 0;
}

/* glow text */
.glow-cloud { text-shadow: 0 0 24px rgba(157,180,255,0.6), 0 0 60px rgba(142,159,245,0.3); }
.glow-teal  { text-shadow: 0 0 24px rgba(79,214,194,0.55), 0 0 60px rgba(70,182,240,0.3); }

/* fade/rise entrance */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.rise { animation: rise 0.9s var(--ease) both; }

/* screen crossfade */
.screen {
  position: absolute;
  inset: 0;
  animation: fade 0.6s var(--ease) both;
}

/* full-bleed background layers sit behind content */
.bg-layer { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.content-layer { position: relative; z-index: 1; }

/* ===================================================================
   snowfield ground (聊天背景 · 雪原 + 极光反光)
   =================================================================== */
.snowfield {
  position: absolute; left: 0; right: 0; bottom: 0; height: 30%;
  background:
    radial-gradient(120% 80% at 50% 100%, rgba(228,240,252,0.95) 0%, rgba(186,212,236,0.82) 38%, rgba(150,186,220,0.45) 66%, transparent 92%),
    linear-gradient(180deg, transparent 0%, rgba(176,206,234,0.30) 40%, rgba(206,228,248,0.7) 100%);
  pointer-events: none;
}
/* horizon glow line — aurora reflecting on the snow */
.snowfield::before {
  content: ""; position: absolute; left: -10%; right: -10%; top: -4%; height: 36%;
  background:
    radial-gradient(60% 100% at 38% 100%, rgba(95,235,185,0.34), transparent 70%),
    radial-gradient(55% 100% at 68% 100%, rgba(80,205,248,0.28), transparent 72%);
  filter: blur(14px); pointer-events: none;
}
/* crisp bright horizon edge */
.snowfield::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(225,245,255,0.7) 30%, rgba(190,255,235,0.6) 60%, transparent);
  filter: blur(1px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; }
}

/* ===================================================================
   shared UI chrome (topbar, hub, login)
   =================================================================== */
.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.22s var(--ease);
}
.icon-btn:hover { background: var(--glass-hi); color: var(--text); border-color: var(--glass-edge); }
.icon-btn:active { transform: scale(0.92); }

.cloud-chip {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 999px; padding: 8px 15px; cursor: pointer;
  transition: all 0.22s var(--ease);
}
.cloud-chip:hover { color: var(--text-soft); border-color: var(--glass-edge); }
.cloud-dot {
  width: 7px; height: 7px; border-radius: 99px;
  background: var(--cloud-glow);
  box-shadow: 0 0 10px 1px var(--cloud-glow);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.hub-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px;
}
@media (max-width: 720px) { .hub-grid { grid-template-columns: 1fr; } }

.hub-card {
  display: flex; align-items: center; gap: 22px;
  padding: 30px 28px; border-radius: var(--r-lg);
  cursor: pointer; text-align: left; color: var(--text);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  position: relative; overflow: hidden;
}
.hub-card::after {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(120% 120% at 10% 0%, var(--cglow), transparent 55%);
  transition: opacity 0.4s var(--ease); pointer-events: none;
}
.hub-card:hover { transform: translateY(-4px); border-color: var(--glass-edge);
  box-shadow: var(--shadow-pop), 0 0 0 1px var(--cglow); }
.hub-card:hover::after { opacity: 0.5; }
.hub-card:active { transform: translateY(-1px) scale(0.992); }

.hub-icon {
  display: grid; place-items: center;
  width: 60px; height: 60px; flex: none;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: var(--glass-2);
}
.hub-arrow { color: var(--text-faint); transition: transform 0.3s var(--ease), color 0.3s var(--ease); }
.hub-card:hover .hub-arrow { color: var(--text-soft); transform: translateX(4px); }

.login-input {
  width: 100%; margin-top: 24px;
  font-family: var(--mono); font-size: 16px; letter-spacing: 0.18em;
  text-align: center; color: var(--text);
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 15px 16px; outline: none;
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.login-input::placeholder { color: var(--text-faint); letter-spacing: 0.1em; }
.login-input:focus { border-color: rgba(240,168,104,0.55); box-shadow: 0 0 0 3px rgba(240,168,104,0.12); }
@keyframes shakeX { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-7px)} 40%,80%{transform:translateX(7px)} }
.login-input.shake { animation: shakeX 0.5s; border-color: rgba(224,121,90,0.8); }

/* ===================================================================
   展示区 (display)
   =================================================================== */
.disp-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.disp-col { max-width: 720px; margin: 0 auto; padding: 0 24px; }

.counter {
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(72px, 18vw, 150px); line-height: 0.95;
  color: var(--aurora-teal); letter-spacing: -0.02em;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}
.counter-clock {
  font-family: var(--mono); font-size: clamp(15px, 3.5vw, 20px);
  color: var(--text-muted); letter-spacing: 0.4em; margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

.date-row {
  display: flex; align-items: stretch; justify-content: center; gap: 0;
  margin: 16px auto 8px; max-width: 460px;
}
.date-cell { flex: 1; text-align: center; padding: 6px 14px; }
.date-cell .tech-label { margin-bottom: 10px; }
.date-num { font-family: var(--mono); font-size: clamp(20px, 5vw, 26px); color: var(--text); letter-spacing: 0.04em; }
.date-sep { width: 1px; background: linear-gradient(180deg, transparent, var(--glass-border), transparent); }

.story {
  padding: 34px 36px; border-radius: var(--r-lg);
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(15px, 2.5vw, 17.5px); line-height: 2.05; color: var(--text-soft);
}
.story p { margin: 0 0 18px; text-wrap: pretty; }
.story p:last-of-type { margin-bottom: 0; }
.sig { margin-top: 26px; font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.12em; color: var(--cloud); text-align: right; }

/* tattoo */
.tattoo { display: grid; grid-template-columns: 0.85fr 1fr; gap: 26px; align-items: start; }
@media (max-width: 680px) { .tattoo { grid-template-columns: 1fr; } }
.tattoo-img { padding: 12px; border-radius: var(--r-lg); position: relative; }
.tattoo-img image-slot { aspect-ratio: 3 / 4; border-radius: 14px; }
@media (max-width: 680px) { .tattoo-img image-slot { aspect-ratio: 4 / 3; } }
.tattoo-meta { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap;
  padding: 13px 6px 4px; font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.tattoo-meta span { display: inline-flex; align-items: center; gap: 7px; }
.leo-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--leo);
  box-shadow: 0 0 9px 1px var(--leo); display: inline-block; }
.tattoo-text { font-family: var(--serif); font-weight: 300; line-height: 1.95;
  font-size: 15px; color: var(--text-soft); }
.tattoo-text p { margin: 0 0 15px; text-wrap: pretty; }
.tattoo-text .tech-label { margin-bottom: 14px; }
.conception {
  margin: 20px 0 0; padding: 16px 20px;
  border-left: 2px solid var(--cloud-deep);
  background: rgba(142,159,245,0.06); border-radius: 0 12px 12px 0;
  font-size: 14px; color: var(--text-muted); line-height: 1.9;
}
.conception .qmark { display: block; margin-top: 12px; color: var(--cloud-glow);
  font-style: normal; font-size: 14.5px; }

/* guestbook */
.gb-form { padding: 20px; border-radius: var(--r-lg); display: flex; flex-direction: column; gap: 12px; }
.gb-input, .gb-textarea {
  width: 100%; font-family: var(--sans); font-size: 14.5px; color: var(--text);
  background: rgba(0,0,0,0.22); border: 1px solid var(--glass-border);
  border-radius: var(--r-sm); padding: 12px 14px; outline: none; resize: none;
  transition: border-color 0.2s var(--ease);
}
.gb-input:focus, .gb-textarea:focus { border-color: rgba(142,159,245,0.5); }
.gb-input::placeholder, .gb-textarea::placeholder { color: var(--text-faint); }
.gb-list { display: grid; gap: 14px; margin-top: 18px; }
.gb-card { padding: 18px 20px; border-radius: var(--r-md); }
.gb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.gb-name { font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--cloud-glow); }
.gb-msg { margin: 0; font-family: var(--serif); font-weight: 300; font-size: 14.5px;
  line-height: 1.85; color: var(--text-soft); text-wrap: pretty; }

/* ===================================================================
   phone device shell
   =================================================================== */
.phone-wrap { display: grid; place-items: center; height: 100%; padding: 22px; position: relative; }
.phone-exit { position: absolute; top: 22px; left: 22px; z-index: 5; }
.phone-stage { height: 100%; display: grid; place-items: center; }
.phone-device {
  position: relative;
  height: min(840px, calc(100vh - 60px));
  aspect-ratio: 410 / 870;
  border-radius: 52px;
  padding: 11px;
  background: linear-gradient(155deg, #2a2f3e, #11141f 55%, #1c2030);
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.10), var(--shadow-pop),
              inset 0 1px 1px rgba(255,255,255,0.18);
}
.phone-screen {
  position: relative; height: 100%; width: 100%;
  border-radius: 42px; overflow: hidden;
  display: flex; flex-direction: column;
}
.status-bar {
  position: relative; z-index: 6;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px 6px; flex: none;
}
.notch { position: absolute; left: 50%; top: 11px; transform: translateX(-50%);
  width: 92px; height: 26px; background: #05070d; border-radius: 99px; }

@media (max-width: 600px) {
  .phone-wrap { padding: 0; }
  .phone-exit { top: 12px; left: 12px; }
  .phone-device { height: 100vh; width: 100vw; aspect-ratio: auto; border-radius: 0; padding: 0; box-shadow: none; }
  .phone-screen { border-radius: 0; }
  .notch { top: 6px; }
}

/* ===================================================================
   territory home (morandi)
   =================================================================== */
.terr-home { flex: 1; display: flex; flex-direction: column; padding: 8px 24px 0; overflow: hidden; }
.terr-hero { padding: 26px 4px 30px; }
.terr-hero .tech-label { color: rgba(255,255,255,0.7); }
.terr-greet { font-family: var(--serif); font-size: 30px; font-weight: 500; color: #fff;
  margin-top: 12px; text-shadow: 0 2px 12px rgba(0,0,0,0.25); }
.terr-sub { color: rgba(255,255,255,0.78); font-size: 14px; margin-top: 7px; font-family: var(--serif); font-weight: 300; }
.app-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 6px; align-content: start; }
.app { background: none; border: 0; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 9px; padding: 0;
  animation: rise 0.6s var(--ease) both; }
.app-icon { position: relative; width: 58px; height: 58px; border-radius: 17px;
  display: grid; place-items: center;
  box-shadow: 0 8px 20px -8px rgba(20,30,50,0.6), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.app:hover .app-icon { transform: translateY(-3px); box-shadow: 0 14px 26px -8px rgba(20,30,50,0.7), 0 0 22px -4px var(--iglow); }
.app:active .app-icon { transform: scale(0.9); }
.app.ghost .app-icon { border: 1px dashed rgba(255,255,255,0.35); box-shadow: none; }
.app-label { font-size: 12px; color: rgba(255,255,255,0.92); text-shadow: 0 1px 4px rgba(0,0,0,0.35); }
.app.ghost .app-label { color: rgba(255,255,255,0.6); }
.app-badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px;
  padding: 0 5px; border-radius: 99px; background: #e0795a; color: #fff;
  font-family: var(--mono); font-size: 11px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px rgba(108,126,158,0.6); }
.dock { margin-top: auto; padding: 16px 0 max(20px, env(safe-area-inset-bottom));
  display: flex; justify-content: center;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.10)); }
.dock-app { animation: none; }

/* ===================================================================
   sheet (mcp & generic)
   =================================================================== */
.sheet, .chat-sheet {
  position: absolute; inset: 0; z-index: 20;
  background: linear-gradient(180deg, #0c1322, #0a0e1c);
  display: flex; flex-direction: column;
  animation: sheetUp 0.34s var(--ease) both;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-head { display: flex; align-items: center; gap: 14px; padding: 24px 22px 14px; flex: none; }
.sheet-body { flex: 1; overflow-y: auto; padding: 8px 22px 28px; }
.mcp-row { display: flex; align-items: center; gap: 13px; padding: 14px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06); }
.mcp-status { width: 9px; height: 9px; border-radius: 99px; flex: none; }
.mcp-status.connected { background: var(--aurora-teal); box-shadow: 0 0 9px 1px var(--aurora-teal); }
.mcp-status.disconnected { background: var(--text-faint); }
.mcp-name { font-family: var(--mono); font-size: 14px; color: var(--text); }
.mcp-url { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcp-toggle { font-family: var(--sans); font-size: 12px; color: var(--text-soft);
  background: var(--glass-2); border: 1px solid var(--glass-border); border-radius: 99px;
  padding: 6px 14px; cursor: pointer; transition: all 0.2s; }
.mcp-toggle:hover { background: var(--glass-hi); }
.mcp-addbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  margin-top: 18px; padding: 14px; border-radius: var(--r-md); cursor: pointer;
  border: 1px dashed var(--glass-border); background: transparent; color: var(--text-soft);
  font-family: var(--sans); font-size: 14px; transition: all 0.2s; }
.mcp-addbtn:hover { border-color: var(--glass-edge); background: var(--glass); }
.mcp-add { padding: 16px; border-radius: var(--r-md); display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* ===================================================================
   chat (微信风)
   =================================================================== */
.chat { position: relative; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat > .content-layer { height: auto; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 6px 16px 14px; flex: none;
  background: linear-gradient(180deg, rgba(5,10,30,0.55), transparent); backdrop-filter: blur(6px); }
.chat-id { flex: 1; cursor: pointer; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.chat-nick { font-family: var(--sans); font-weight: 600; font-size: 16px; color: #fff; }
.chat-status { width: 100%; display: flex; align-items: center; gap: 7px; font-family: var(--mono);
  font-size: 10.5px; color: rgba(255,255,255,0.7); letter-spacing: 0.04em; margin-top: 2px; }
.nick-in { font-family: var(--sans); font-weight: 600; font-size: 16px; color: #fff;
  background: rgba(255,255,255,0.12); border: 1px solid var(--glass-edge); border-radius: 8px;
  padding: 3px 8px; outline: none; width: 130px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 6px 16px 14px; display: flex; flex-direction: column; gap: 4px; }
.chat-daydiv { text-align: center; margin: 6px 0 14px; }
.chat-daydiv span { font-family: var(--serif); font-size: 11.5px; color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.28); padding: 5px 13px; border-radius: 99px; backdrop-filter: blur(8px); }
.empty-win { text-align: center; color: rgba(255,255,255,0.6); font-family: var(--serif); margin-top: 40px; font-size: 14px; }

.row { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.row.user { flex-direction: row-reverse; }
.bot-stack { display: flex; flex-direction: column; gap: 7px; max-width: 78%; align-items: flex-start; }
.avatar { border-radius: 13px; display: grid; place-items: center; flex: none;
  border: 1px solid rgba(255,255,255,0.22); }

.bubble { font-size: 14.5px; line-height: 1.65; padding: 10px 14px; border-radius: 17px;
  max-width: 78%; word-break: break-word; position: relative; text-wrap: pretty;
  text-shadow: 0 1px 3px rgba(8,16,38,0.4); }
.glass-bubble { backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.24); box-shadow: 0 8px 22px -10px rgba(0,0,0,0.6); }
.bubble.cloud { background: rgba(108,122,214,0.44); color: #f3f5ff; border-top-left-radius: 6px; }
.bubble.leo { background: rgba(216,150,92,0.46); color: #fff; border-top-right-radius: 6px; }
.caret { display: inline-block; width: 2px; height: 1em; background: #fff; margin-left: 2px;
  vertical-align: -2px; animation: blink 0.9s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.typing { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.typing i { width: 6px; height: 6px; border-radius: 99px; background: rgba(255,255,255,0.7);
  animation: bob 1.1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* thinking */
.think { width: 100%; border-radius: 14px; overflow: hidden;
  background: rgba(10,16,34,0.42); border: 1px solid rgba(157,180,255,0.22);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.think-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: none; border: 0; cursor: pointer; color: var(--cloud-glow); }
.think-body { padding: 2px 14px 14px; }
.think-text { margin: 0; font-size: 13px; line-height: 1.75; color: rgba(220,228,255,0.82);
  font-family: var(--serif); font-weight: 300; }
.tool { margin: 7px 0; font-family: var(--mono); font-size: 11.5px; }
.tool-call { display: flex; align-items: center; gap: 6px; color: var(--cloud-glow); flex-wrap: wrap; }
.tool-args { color: var(--text-faint); }
.tool-result { display: flex; align-items: center; gap: 6px; color: var(--text-muted); margin: 3px 0 0 18px; }

.token-bar { display: flex; align-items: center; gap: 9px; margin-top: 3px; padding-left: 3px; }
.token-dot { width: 3px; height: 3px; border-radius: 99px; background: var(--text-faint); }

.composer { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(10,24,44,0.7), rgba(10,24,44,0.28) 55%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.composer-in { flex: 1; font-family: var(--sans); font-size: 14.5px; color: #fff;
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.28); border-radius: 22px;
  padding: 12px 18px; outline: none; transition: border-color 0.2s; }
.composer-in::placeholder { color: rgba(255,255,255,0.55); }
.composer-in:focus { border-color: rgba(157,180,255,0.7); }
.send-btn { flex: none; width: 44px; height: 44px; border-radius: 99px; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(150deg,#a98bf5,#6f6bd8);
  box-shadow: 0 6px 18px -6px rgba(157,180,255,0.8); transition: transform 0.2s, opacity 0.2s; }
.send-btn:hover { transform: translateY(-1px); } .send-btn:active { transform: scale(0.9); }
.send-btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; }

/* settings sheet bits */
.set-label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted); margin: 18px 0 9px; }
.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.model-pill { font-family: var(--sans); font-size: 13.5px; color: var(--text-soft);
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 12px;
  padding: 11px; cursor: pointer; transition: all 0.2s; }
.model-pill.on { color: #fff; border-color: rgba(157,180,255,0.6); background: rgba(142,159,245,0.16);
  box-shadow: 0 0 0 1px rgba(142,159,245,0.2); }
.mono-in { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.02em; }
.set-hint { font-family: var(--sans); font-size: 11.5px; color: var(--text-faint); margin-top: 9px; line-height: 1.6; }
.seg { display: flex; gap: 6px; background: rgba(0,0,0,0.25); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 4px; }
.seg button { flex: 1; font-family: var(--sans); font-size: 13px; color: var(--text-muted);
  background: none; border: 0; border-radius: 9px; padding: 9px; cursor: pointer; transition: all 0.2s; }
.seg button.on { background: var(--glass-hi); color: #fff; }

/* window drawer */
.drawer-scrim { position: absolute; inset: 0; z-index: 19; background: rgba(0,0,0,0.45); animation: fade 0.3s; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 84%; max-width: 320px; z-index: 21;
  background: linear-gradient(180deg, #0c1322, #0a0e1c); animation: drawerIn 0.32s var(--ease) both;
  display: flex; flex-direction: column; box-shadow: -20px 0 50px -20px rgba(0,0,0,0.8); }
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-list { flex: 1; overflow-y: auto; padding: 6px 12px 20px; display: flex; flex-direction: column; gap: 4px; }
.win-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px;
  background: none; border: 0; cursor: pointer; transition: background 0.2s; }
.win-item:hover { background: var(--glass); } .win-item.on { background: var(--glass-2); }
.win-title { font-family: var(--sans); font-weight: 600; font-size: 14.5px; color: var(--text); }
.win-last { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
