:root {
  --bg: #000000;
  --panel: #050507;
  --panel-2: #0a0a0d;
  --line: #16161a;
  --line-2: #22222a;
  --text: #ffffff;
  --muted: #7e7e86;
  --red: #ff3b30;
  --red-dim: rgba(255, 59, 48, 0.15);
  --green: #30d158;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --sidebar-w: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

html, body {
  height: 100%;
  font-family: var(--sans);
  background-color: var(--bg);
  background-image: radial-gradient(rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--text);
  overflow: hidden;
}

#app {
  display: flex;
  height: 100vh;
  height: 100dvh;
}

button { font-family: var(--mono); }
button:focus { outline: none; }
button:focus-visible { outline: 1px solid var(--text); outline-offset: 2px; }

/* ---------- sidebar ---------- */

#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 20;
  transition: margin-left 0.2s ease;
}

#sidebar.collapsed {
  margin-left: calc(var(--sidebar-w) * -1);
}

#sidebarHeader {
  padding: 14px 14px 10px;
  flex-shrink: 0;
}

.new-chat-btn {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--text);
  font: 700 12px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.new-chat-btn:hover { background: #14141a; border-color: var(--text); }

.hist-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
}

.hist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.12s;
  animation: fade 0.15s ease;
  flex-shrink: 0;
}
.hist-item:hover { background: var(--panel-2); }
.hist-item.current { background: var(--panel-2); border: 1px solid var(--line-2); }
.hist-item .hist-title { flex: 1; font-size: 13px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-item .hist-meta { flex: none; font-family: var(--mono); font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.hist-item.current .hist-meta { color: var(--text); }

/* ---------- sidebar overlay (mobile) ---------- */

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 19;
  display: none;
}
.sidebar-overlay.visible { display: block; }

/* ---------- main ---------- */

#main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* ---------- top bar ---------- */

#topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  padding-top: calc(0px + var(--safe-top));
  height: 56px;
  background: rgba(0,0,0,0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
  z-index: 10;
  flex-shrink: 0;
}

.sidebar-toggle {
  appearance: none; -webkit-appearance: none;
  background: none; border: none;
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 8px;
  transition: background 0.12s;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--panel-2); }

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font: 800 16px var(--mono);
  flex: none;
}

.brand-text { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }

.brand-text strong {
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700;
}

.subtitle { font-size: 10px; color: var(--muted); font-family: var(--mono); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.online { background: var(--green); box-shadow: 0 0 8px rgba(48, 209, 88, 0.5); }
.dot.busy { background: var(--red); box-shadow: 0 0 8px rgba(255, 59, 48, 0.5); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }

.pill {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 12px;
  font: 700 10px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, border-color 0.12s;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.pill:hover { background: #14141a; }
.pill:active { background: #16161a; }
.pill.off { color: var(--muted); }
.pill.primary { background: var(--text); color: #000; border-color: var(--text); }
.pill.primary:hover { background: #e8e8ea; }

.call-btn.active {
  background: var(--red); border-color: var(--red); color: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.5); }
  50% { box-shadow: 0 0 0 9px rgba(255, 59, 48, 0); }
}

.select {
  appearance: none; -webkit-appearance: none;
  background-color: var(--panel-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%2388888e'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 8px 28px 8px 12px;
  font: 700 11px var(--mono);
  letter-spacing: 0.04em;
  cursor: pointer;
  max-width: 190px;
  outline: none;
}
.select:focus { border-color: var(--text); }
.select option { background: var(--panel-2); color: var(--text); }

/* ---------- chat ---------- */

#chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px 18px 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

#messages {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.msg {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  animation: fade 0.2s ease;
  max-width: 100%;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.msg:last-child { border-bottom: none; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font: 700 12px var(--mono);
  flex: none;
  margin-top: 2px;
}
.msg.user .msg-avatar { color: var(--text); }

.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-label {
  font: 700 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.msg.user .msg-label { color: var(--text); }

.bubble {
  line-height: 1.55;
  font-size: 15px;
  white-space: pre-wrap;
  word-wrap: break-word;
  position: relative;
}

.msg.jef .bubble { color: var(--text); }
.msg.user .bubble { color: var(--text); }

.speak-replay {
  background: none; border: none; cursor: pointer;
  font: 700 9px var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); opacity: 0; transition: opacity 0.15s;
  margin-top: 6px;
}
.msg.jef:hover .speak-replay { opacity: 1; }
.speak-replay:hover { color: var(--text); }

.caret {
  display: inline-block; width: 8px; height: 15px;
  background: var(--text);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 0.8s steps(2) infinite;
}

.typing .bubble {
  display: flex; gap: 5px; align-items: center;
  min-width: 54px; min-height: 30px;
}
.typing .tydot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite; }
.typing .tydot:nth-child(2) { animation-delay: 0.15s; }
.typing .tydot:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.tool-chip {
  align-self: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--line-2);
  padding: 4px 10px;
  border-radius: 999px;
  max-width: 80%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin: 8px 0;
}

.sys-msg {
  align-self: center; text-align: center;
  color: var(--muted); font-size: 11px; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.06em;
  max-width: 80%;
  padding: 12px 0;
}

.greeting-card {
  align-self: center; text-align: center;
  margin-top: 30px; margin-bottom: 10px;
  animation: fade 0.35s ease;
}
.greeting-card .big-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font: 800 30px var(--mono);
  margin: 0 auto 18px;
}
.greeting-card h2 { font-size: 17px; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; }
.greeting-card p { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.greeting-card .chips { display: flex; gap: 8px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

.chip {
  background: var(--panel-2); border: 1px solid var(--line-2);
  color: var(--text); font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  transition: background 0.12s;
}
.chip:hover { background: #14141a; }

/* ---------- input bar ---------- */

#inputbar {
  padding: 10px 16px 14px;
  padding-bottom: calc(14px + var(--safe-bottom));
  flex-shrink: 0;
}

#inputWrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 24px;
  padding: 8px 8px 8px 18px;
  max-width: 760px;
  margin: 0 auto;
  backdrop-filter: blur(14px);
  transition: border-color 0.15s;
}
#inputWrap:focus-within { border-color: var(--text); }

#textInput {
  flex: 1;
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 15px; font-family: var(--sans);
  resize: none; max-height: 140px; line-height: 1.45;
  padding: 8px 0;
}
#textInput::placeholder { color: var(--muted); }
#textInput:disabled { opacity: 0.45; }

.mic { font-size: 10px; }
.mic.recording {
  background: var(--red); border-color: var(--red); color: #fff;
  animation: pulse 1s infinite;
}

.send { flex: none; }

.hint { text-align: center; color: var(--muted); font-size: 10px; font-family: var(--mono); margin-top: 8px; letter-spacing: 0.04em; text-transform: uppercase; max-width: 760px; margin-left: auto; margin-right: auto; }

/* ---------- call overlay ---------- */

#callOverlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.96);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } }
#callOverlay.hidden { display: none; }

.call-card {
  text-align: center; padding: 30px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  width: min(420px, 92vw);
}

.call-ring { position: relative; width: 140px; height: 140px; }
.call-ring::before, .call-ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35);
  animation: ring 2.4s ease-out infinite;
}
.call-ring::after { animation-delay: 1.2s; }
@keyframes ring {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}
.call-ring.listening::before, .call-ring.listening::after { border-color: rgba(255, 59, 48, 0.6); }
.call-ring.speaking::before, .call-ring.speaking::after { border-color: rgba(255, 255, 255, 0.7); }

.call-avatar {
  position: absolute; inset: 24px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font: 800 42px var(--mono);
}

.call-status {
  font-size: 16px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.call-sub { color: var(--muted); font-size: 10px; font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; min-height: 14px; margin-top: -8px; }

.hold-btn {
  width: 150px; height: 150px; border-radius: 50%;
  border: 1px solid var(--text); cursor: pointer;
  background: var(--text);
  color: #000; font: 700 12px var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  transition: transform 0.12s, background 0.12s, color 0.12s, box-shadow 0.12s;
  touch-action: none !important;
  user-select: none;
  -webkit-user-select: none;
}
.hold-btn:active, .hold-btn.pressed {
  transform: scale(0.94);
  background: var(--red); border-color: var(--red); color: #fff;
  box-shadow: 0 0 0 8px var(--red-dim);
}

.end-btn { color: var(--muted); }
.end-btn:hover { color: var(--red); border-color: var(--red); }

/* ---------- memory panel ---------- */

#memOverlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,0.96);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  animation: fade 0.2s ease;
}
#memOverlay.hidden { display: none; }

.mem-panel {
  width: min(600px, 94vw);
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  overflow: hidden;
}

.mem-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.mem-head strong { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; }
.mem-count { flex: 1; color: var(--muted); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }

.mem-add {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.mem-input {
  flex: 1;
  background: var(--panel-2); border: 1px solid var(--line-2);
  color: var(--text); font-size: 13px; font-family: var(--sans);
  border-radius: 12px; padding: 9px 12px; outline: none;
}
.mem-input:focus { border-color: var(--text); }
.mem-input::placeholder { color: var(--muted); }
.mem-select { max-width: 150px; padding: 9px 28px 9px 12px; }

.mem-list {
  flex: 1; overflow-y: auto;
  padding: 12px 18px 18px;
}

.mem-group { margin-bottom: 16px; }
.mem-group:last-child { margin-bottom: 0; }

.mem-group-label {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.mem-group-label .n { color: var(--muted); opacity: 0.6; }

.mem-fact {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  animation: fade 0.15s ease;
}
.mem-fact.pinned { border-color: var(--line-2); }
.mem-fact-text { flex: 1; font-size: 13px; line-height: 1.45; min-width: 0; }
.mem-fact .tag {
  flex: none; font-family: var(--mono); font-size: 8px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 7px;
}
.mem-fact .src { flex: none; font-family: var(--mono); font-size: 9px; color: var(--muted); opacity: 0.5; }

.mem-btn {
  flex: none; background: none; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); padding: 4px 6px; border-radius: 8px;
  transition: color 0.12s, background 0.12s;
}
.mem-btn:hover { background: #14141a; color: var(--text); }
.mem-btn.pin.on { color: var(--text); }
.mem-btn.del:hover { color: var(--red); }

.mem-empty { text-align: center; color: var(--muted); font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 30px 0; }

/* ---------- login ---------- */

#loginWrap {
  height: 100vh;
  height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.login-card {
  width: min(360px, 94vw);
  display: flex; flex-direction: column; align-items: center;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 24px;
  padding: 40px 30px 26px;
  animation: fade 0.3s ease;
}
.login-card .big-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font: 800 28px var(--mono);
  margin-bottom: 16px;
}
.login-card h2 { font-size: 15px; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: 10px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 22px; }

.login-tabs {
  display: flex; gap: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
  width: 100%;
}
.login-tabs .tab {
  flex: 1;
  background: none; border: none; cursor: pointer;
  color: var(--muted);
  font: 700 10px var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 9px 0; border-radius: 9px;
  transition: background 0.12s, color 0.12s;
}
.login-tabs .tab.active { background: var(--text); color: #000; }
.login-tabs .tab:not(.active):hover { color: var(--text); }

.login-label {
  align-self: flex-start;
  color: var(--muted); font-size: 10px; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.login-card .login-label:not(:first-of-type) { margin-top: 14px; }

.login-input {
  width: 100%;
  background: var(--panel-2); border: 1px solid var(--line-2);
  color: var(--text); font-size: 15px; font-family: var(--sans);
  border-radius: 12px; padding: 11px 14px; outline: none;
}
.login-input:focus { border-color: var(--text); }

.login-error {
  margin-top: 14px; color: #ffb3ba; font-size: 11px; font-family: var(--mono);
  letter-spacing: 0.04em; text-transform: uppercase; text-align: center;
}
.login-error.hidden { display: none; }

.login-btn { margin-top: 22px; width: 100%; justify-content: center; padding: 11px; font-size: 11px; }
.login-btn:disabled { opacity: 0.5; cursor: default; }

.login-hint { color: var(--muted); font-size: 10px; font-family: var(--mono); letter-spacing: 0.04em; margin-top: 16px; text-align: center; }

/* ---------- misc ---------- */

#toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 8px; z-index: 100;
  align-items: center;
}
.toast {
  background: var(--panel-2); border: 1px solid var(--line-2);
  color: var(--text); padding: 10px 18px; border-radius: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  animation: fade 0.2s ease;
}
.toast.error { border-color: var(--red); color: #ffb3ba; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #22222a; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #33333d; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 20;
    box-shadow: none;
    transition: transform 0.22s ease;
    transform: translateX(0);
  }
  #sidebar.collapsed {
    transform: translateX(calc(var(--sidebar-w) * -1));
    margin-left: 0;
  }
  #sidebar:not(.collapsed) {
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
  }
}

@media (max-width: 720px) {
  #topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    padding-top: calc(10px + var(--safe-top));
    gap: 8px;
  }
  .brand { gap: 10px; }
  .avatar { width: 34px; height: 34px; font-size: 14px; }
  .brand-text strong { font-size: 12px; }
  .subtitle { display: none; }
  .controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 6px;
    justify-items: stretch;
  }
  .controls .select {
    max-width: none;
    min-width: 0;
    width: 100%;
    grid-column: span 2;
    font-size: 10px;
    padding: 10px 28px 10px 10px;
  }
  .pill {
    padding: 10px 8px;
    font-size: 10px;
    justify-content: center;
    min-height: 40px;
  }
  .controls .pill.primary { grid-column: span 2; }

  #chat { padding: 14px 10px 8px; }
  .msg { gap: 10px; padding: 14px 0; }
  .msg-avatar {
    width: 24px; height: 24px;
    font-size: 10px;
  }

  .speak-replay { opacity: 0.7; font-size: 10px; padding: 6px 8px; }

  #inputbar {
    padding: 8px 10px 10px;
    padding-bottom: calc(10px + var(--safe-bottom));
  }
  #inputWrap {
    padding: 6px 6px 6px 14px;
    border-radius: 22px;
    gap: 6px;
  }
  #textInput {
    font-size: 16px;
    padding: 10px 0;
    min-height: 24px;
  }
  .mic, .send {
    min-width: 42px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    padding: 0 10px;
  }
  .hint { margin-top: 4px; font-size: 9px; }

  .chip {
    padding: 10px 14px;
    font-size: 10px;
  }

  .greeting-card { margin-top: 16px; }
  .greeting-card .big-avatar { width: 60px; height: 60px; font-size: 26px; margin-bottom: 14px; }
  .greeting-card h2 { font-size: 15px; }

  .mem-panel {
    width: 100vw;
    max-height: 100dvh;
    border-radius: 20px 20px 0 0;
    margin-top: auto;
  }
  #memOverlay {
    align-items: flex-end;
    padding-bottom: var(--safe-bottom);
  }
  .mem-head { padding: 16px 18px; }
  .mem-add { flex-wrap: wrap; padding: 12px 14px; }
  .mem-input {
    min-height: 44px;
    font-size: 16px;
    flex: 1 1 100%;
  }
  .mem-select { max-width: none; flex: 0 0 auto; }
  .mem-add .pill { min-height: 44px; padding: 10px 16px; }
  .mem-list { padding: 10px 14px 20px; }

  .mem-fact {
    flex-wrap: wrap;
    padding: 12px;
    gap: 8px;
  }
  .mem-btn {
    padding: 8px 10px;
    font-size: 10px;
    min-height: 36px;
  }
  .mem-group-label { font-size: 11px; }

  .call-card { padding: 20px; gap: 14px; }
  .call-ring { width: 120px; height: 120px; }
  .call-avatar { inset: 20px; font-size: 36px; }
  .hold-btn {
    width: 130px; height: 130px;
    font-size: 11px;
  }

  .login-card {
    padding: 30px 22px 22px;
    border-radius: 20px;
  }
  .login-input { font-size: 16px; padding: 13px 14px; }
  .login-btn { min-height: 48px; font-size: 12px; }
  .login-tabs .tab { padding: 12px 0; font-size: 11px; }

  ::-webkit-scrollbar { width: 3px; }
}
