* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #faf7f2;
  --user-bubble: #e8d5c4;
  --assistant-bubble: #ffffff;
  --thinking-bg: #f0ede8;
  --accent: #b89578;
  --text: #333333;
  --text-muted: #888888;
  --border: #e5ddd5;
  --header-bg: #ffffff;
  --sidebar-bg: #f5f1eb;
  --sidebar-w: 260px;
}

/* ===== Views ===== */

.view { height: 100%; }
.view.hidden { display: none !important; }

/* ===== Homepage ===== */

#view-home {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.8s ease;
}

.home-mood-calm {
  --hm-text: #333; --hm-muted: #888; --hm-accent: #b89578;
  --hm-card: rgba(255,255,255,0.75); --hm-border: #e5ddd5;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(200,180,160,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 85%, rgba(190,170,150,0.08) 0%, transparent 50%),
    #faf7f2;
}
.home-mood-shy {
  --hm-text: #4a3040; --hm-muted: #9a7888; --hm-accent: #c4849a;
  --hm-card: rgba(255,240,245,0.8); --hm-border: rgba(210,170,185,0.4);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,180,200,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 75%, rgba(255,160,190,0.12) 0%, transparent 50%),
    #fdf4f6;
}
.home-mood-jealous {
  --hm-text: #2a3a2e; --hm-muted: #6a8a70; --hm-accent: #7a9e7e;
  --hm-card: rgba(240,255,243,0.8); --hm-border: rgba(160,200,165,0.4);
  background:
    radial-gradient(ellipse at 35% 25%, rgba(160,210,170,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 65% 80%, rgba(140,200,150,0.1) 0%, transparent 50%),
    #f2f8f3;
}
.home-mood-sincere {
  --hm-text: #3a2020; --hm-muted: #8a6060; --hm-accent: #c08080;
  --hm-card: rgba(255,245,243,0.8); --hm-border: rgba(200,160,155,0.4);
  background:
    radial-gradient(ellipse at 25% 30%, rgba(220,160,150,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 70%, rgba(210,140,140,0.1) 0%, transparent 50%),
    #fdf4f2;
}
.home-mood-dark {
  --hm-text: #d0d0d0; --hm-muted: #777; --hm-accent: #888;
  --hm-card: rgba(45,45,55,0.8); --hm-border: rgba(255,255,255,0.08);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(80,60,80,0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(60,50,70,0.2) 0%, transparent 50%),
    #1a1a22;
}
.home-mood-fire {
  --hm-text: #3a1a10; --hm-muted: #8a5a40; --hm-accent: #d07040;
  --hm-card: rgba(255,245,238,0.8); --hm-border: rgba(210,150,120,0.3);
  background:
    radial-gradient(ellipse at 25% 25%, rgba(255,160,100,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 75%, rgba(255,120,60,0.1) 0%, transparent 50%),
    #fdf2ec;
}

.home-bg {
  width: 100%;
  max-width: 420px;
  padding: 0 24px;
}

.home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* --- Tangyuan --- */

.tangyuan-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.tangyuan {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #fff 0%, #f5ede5 60%, #ebe0d4 100%);
  position: relative;
  animation: ty-float 3.5s ease-in-out infinite;
  transition: background 0.8s ease;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

.ty-highlight {
  position: absolute;
  width: 18px; height: 14px;
  background: rgba(255,255,255,0.7);
  border-radius: 50%;
  top: 18%; left: 28%;
  transform: rotate(-20deg);
}

/* --- Eyes: vertical bean style --- */

.ty-eye {
  position: absolute;
  width: 4.5px; height: 12px;
  background: #3a3a3a;
  border-radius: 2.5px;
  top: 39%;
  transition: all 0.3s ease;
}
.ty-eye-l { left: 33%; }
.ty-eye-r { right: 33%; }

.ty-pupil { display: none; }

.ty-mouth {
  position: absolute;
  width: 12px; height: 6px;
  border: 2px solid #3a3a3a;
  border-top: none;
  border-radius: 0 0 12px 12px;
  bottom: 32%;
  left: 50%;
  transform: translateX(-50%);
  transition: all 0.3s ease;
}

.ty-blush {
  position: absolute;
  width: 16px; height: 10px;
  background: rgba(255,150,150,0.55);
  border-radius: 50%;
  top: 50%;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.ty-blush-l { left: 13%; }
.ty-blush-r { right: 13%; }

.ty-shadow {
  width: 70px; height: 10px;
  background: rgba(0,0,0,0.06);
  border-radius: 50%;
  animation: ty-shadow 3.5s ease-in-out infinite;
}

/* --- Mood: calm (default) --- */
.tangyuan.mood-calm {
  background: radial-gradient(circle at 38% 35%, #fff 0%, #f5ede5 60%, #ebe0d4 100%);
}

/* --- Mood: shy --- */
.tangyuan.mood-shy {
  background: radial-gradient(circle at 38% 35%, #fff 0%, #ffd6e0 60%, #ffb6c8 100%);
}
.tangyuan.mood-shy .ty-blush { opacity: 1; }
.tangyuan.mood-shy .ty-eye { height: 9px; width: 3px; }
.tangyuan.mood-shy .ty-eye-l { transform: rotate(8deg); }
.tangyuan.mood-shy .ty-eye-r { transform: rotate(-8deg); }
.tangyuan.mood-shy .ty-mouth {
  width: 8px; height: 8px;
  border: 2px solid #3a3a3a;
  border-radius: 50%;
  bottom: 30%;
}

/* --- Mood: jealous --- */
.tangyuan.mood-jealous {
  background: radial-gradient(circle at 38% 35%, #f0fff0 0%, #c8e8c8 60%, #a8d8a8 100%);
}
.tangyuan.mood-jealous .ty-eye-l { transform: rotate(-10deg); top: 38%; }
.tangyuan.mood-jealous .ty-eye-r { transform: rotate(10deg); top: 38%; }
.tangyuan.mood-jealous .ty-mouth {
  width: 10px; height: 5px;
  border-top: 2px solid #3a3a3a;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  bottom: 30%;
}

/* --- Mood: sincere --- */
.tangyuan.mood-sincere {
  background: radial-gradient(circle at 38% 35%, #fff5f5 0%, #f0c8c8 60%, #e8a8a8 100%);
}
.tangyuan.mood-sincere .ty-eye {
  width: 6px; height: 14px; border-radius: 3px;
}
.tangyuan.mood-sincere .ty-mouth {
  width: 14px; height: 7px;
}
.tangyuan.mood-sincere .ty-blush { opacity: 0.4; }

/* --- Mood: dark --- */
.tangyuan.mood-dark {
  background: radial-gradient(circle at 38% 35%, #777 0%, #4a4a4a 60%, #333 100%);
}
.tangyuan.mood-dark .ty-eye {
  width: 8px; height: 3px;
  border-radius: 1px;
  background: #e44;
  top: 42%;
}
.tangyuan.mood-dark .ty-mouth {
  width: 10px; height: 0;
  border-bottom: 2px solid #e44;
  border-radius: 0;
  border-left: none; border-right: none;
}
.tangyuan.mood-dark .ty-highlight { background: rgba(255,255,255,0.12); }

/* --- Mood: fire --- */
.tangyuan.mood-fire {
  background: radial-gradient(circle at 38% 35%, #ffe0c0 0%, #ff9060 60%, #e85030 100%);
}
.tangyuan.mood-fire .ty-blush { opacity: 0.6; background: rgba(255,80,40,0.3); }
.tangyuan.mood-fire .ty-eye {
  width: 6px; height: 6px;
  border-radius: 1px 1px 3px 3px;
  top: 41%;
}
.tangyuan.mood-fire .ty-eye-l { transform: rotate(-5deg); }
.tangyuan.mood-fire .ty-eye-r { transform: rotate(5deg); }
.tangyuan.mood-fire .ty-mouth {
  width: 10px; height: 5px;
  border-radius: 0 0 10px 10px;
  transform: translateX(-50%) skewX(-5deg);
}

/* --- Tangyuan animations --- */

@keyframes ty-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes ty-shadow {
  0%, 100% { transform: scale(1); opacity: 0.06; }
  50% { transform: scale(0.8); opacity: 0.03; }
}

/* Shared actions */
.tangyuan.act-blink .ty-eye { transform: scaleY(0.1) !important; }

.tangyuan.act-bounce { animation: ty-bounce 0.6s ease; }
@keyframes ty-bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-22px); }
  50% { transform: translateY(0); }
  70% { transform: translateY(-10px); }
}

.tangyuan.act-wobble { animation: ty-wobble 0.8s ease; }
@keyframes ty-wobble {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(6deg); }
  60% { transform: rotate(-4deg); }
  80% { transform: rotate(2deg); }
}

/* Happy squint: eyes become ^ ^ */
.tangyuan.act-happy .ty-eye {
  width: 8px !important; height: 3px !important;
  background: transparent !important;
  border-top: 2.5px solid #3a3a3a;
  border-radius: 50% !important;
  top: 43% !important;
}
.tangyuan.act-happy .ty-mouth { width: 16px; height: 8px; }

/* Shy peek: eyes shift to one side */
.tangyuan.act-peek .ty-eye-l { transform: translateX(2px); }
.tangyuan.act-peek .ty-eye-r { transform: translateX(2px); }

/* Shrink: shy hiding */
.tangyuan.act-shrink { animation: ty-shrink 0.8s ease; }
@keyframes ty-shrink {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.85) translateY(5px); }
}

/* Puff: jealous inflate */
.tangyuan.act-puff { animation: ty-puff 0.6s ease; }
@keyframes ty-puff {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.12, 1.05); }
}

/* Nod */
.tangyuan.act-nod { animation: ty-nod 0.6s ease; }
@keyframes ty-nod {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(4px); }
  60% { transform: translateY(-2px); }
}

/* Shake: dark trembling */
.tangyuan.act-shake { animation: ty-shake 0.4s ease; }
@keyframes ty-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* Pulse: fire throb */
.tangyuan.act-pulse { animation: ty-pulse 0.5s ease; }
@keyframes ty-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Sway: fire sway */
.tangyuan.act-sway { animation: ty-sway 1s ease; }
@keyframes ty-sway {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(4deg) translateX(3px); }
  75% { transform: rotate(-4deg) translateX(-3px); }
}

/* Mood label */

.mood-label {
  font-size: 14px;
  color: var(--hm-muted, var(--text-muted));
  letter-spacing: 1px;
  transition: color 0.5s, opacity 0.3s;
  margin-top: 6px;
  margin-bottom: 0;
}

/* Anniversary */

.anniversary-card {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--hm-border, var(--border));
  border-radius: 14px;
  background: var(--hm-card, rgba(255,255,255,0.7));
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  transition: all 0.4s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 28px;
  margin-bottom: 12px;
}

.anni-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.anni-label {
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-size: 14px;
  color: var(--hm-muted, var(--text-muted));
  letter-spacing: 0.5px;
  transition: color 0.4s;
}

.anni-num {
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--hm-accent, var(--accent));
  letter-spacing: 1.5px;
  margin: 0 2px;
  transition: color 0.4s;
}

.anni-unit {
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-size: 14px;
  color: var(--hm-muted, var(--text-muted));
  transition: color 0.4s;
}

.anni-divider {
  width: 40px;
  height: 1px;
  background: var(--hm-border, var(--border));
  align-self: center;
  transition: background 0.4s;
}

/* Home cards */

.home-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.home-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: var(--hm-card, #fff);
  border: 1px solid var(--hm-border, var(--border));
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.4s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: var(--hm-accent, var(--accent));
}

.home-card:active {
  transform: translateY(0);
}

.card-icon { font-size: 28px; }

.card-text {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--hm-text, var(--text));
  letter-spacing: 1.5px;
  transition: color 0.4s;
}

/* ===== Glances ===== */

#view-glances {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #f9f3f0 0%, #f4eae5 50%, #f0e4df 100%);
}

.gl-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(200,180,170,0.3);
  font-weight: 600; font-size: 15px;
}

.gl-title-text {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 17px;
  letter-spacing: 2px;
  color: #8a6a5e;
}

.gl-timeline {
  flex: 1; overflow-y: auto;
  padding: 20px 12px;
  position: relative;
}

.gl-timeline::before {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(184,149,120,0.3) 10%, rgba(184,149,120,0.3) 90%, transparent);
}

.gl-entry {
  display: flex;
  margin-bottom: 20px;
  position: relative;
  animation: fadeIn 0.3s ease;
}

.gl-entry.left { justify-content: flex-start; padding-right: 52%; }
.gl-entry.right { justify-content: flex-end; padding-left: 52%; }

.gl-dot {
  position: absolute;
  left: 50%; top: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(184,149,120,0.4);
}
.gl-entry.left .gl-dot { background: #b8a090; }
.gl-entry.right .gl-dot { background: #c4917a; }

.gl-card {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  border: 1px solid rgba(200,180,170,0.2);
  max-width: 100%;
  position: relative;
}

.gl-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.gl-time {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 11px;
  color: #b8a090;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.gl-quote {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-style: italic;
  font-size: 13px;
  color: #6a5a52;
  line-height: 1.6;
  padding: 8px 12px;
  border-left: 2px solid rgba(184,149,120,0.4);
  margin-bottom: 6px;
  background: rgba(245,238,232,0.5);
  border-radius: 0 8px 8px 0;
}

.gl-content {
  font-size: 13px;
  color: #5a4a42;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.gl-tags-row {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 8px;
}

.gl-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(184,149,120,0.12);
  color: #8a6a5e;
  letter-spacing: 0.5px;
}

.gl-locate {
  font-size: 11px;
  color: #b8a090;
  cursor: pointer;
  margin-top: 6px;
  display: inline-block;
}
.gl-locate:hover { color: #8a6a5e; text-decoration: underline; }

.gl-actions {
  display: flex; gap: 6px; margin-top: 6px;
  opacity: 0; transition: opacity 0.15s;
}
.gl-card:hover .gl-actions { opacity: 1; }
@media (hover: none) { .gl-actions { opacity: 0.6; } }
.gl-actions button {
  font-size: 11px; padding: 2px 8px;
  border: none; background: none;
  color: #c4a090; cursor: pointer; font-family: inherit; border-radius: 4px;
}
.gl-actions button:hover { color: #8a6a5e; background: rgba(184,149,120,0.1); }
.gl-del-btn:hover { color: #c96b6b !important; }

.gl-author {
  font-size: 10px;
  color: #c4a090;
  margin-bottom: 2px;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
}

.gl-empty {
  text-align: center;
  color: #c4a090;
  padding: 60px 20px;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 14px;
  font-style: italic;
}

/* Glance form */
#gl-form, #gl-tags-panel {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  background: #f9f3f0;
}
#gl-form.hidden, #gl-tags-panel.hidden { display: none !important; }

.gl-form-body {
  padding: 16px; flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
}
.gl-form-body label { font-size: 13px; font-weight: 600; color: #6a5a52; }
.gl-form-body input, .gl-form-body textarea, .gl-form-body select {
  padding: 10px 14px;
  border: 1px solid rgba(200,180,170,0.4); border-radius: 12px;
  font-size: 14px; font-family: inherit; outline: none;
  background: rgba(255,255,255,0.7); color: #5a4a42;
}
.gl-form-body textarea { resize: vertical; line-height: 1.5; width: 100%; }
#gf-quote-section { width: 100%; display: flex; flex-direction: column; gap: 10px; }

.gf-tags-wrap {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.gf-tag-btn {
  padding: 4px 12px; border-radius: 12px;
  border: 1px solid rgba(184,149,120,0.3);
  background: transparent; color: #8a6a5e;
  font-size: 12px; cursor: pointer; font-family: inherit;
}
.gf-tag-btn.selected { background: #b8a090; color: #fff; border-color: #b8a090; }

.gf-custom-tag-row {
  display: flex; gap: 6px; margin-top: 2px;
}
.gf-custom-tag-row input {
  flex: 1; padding: 6px 12px;
  border: 1px solid rgba(184,149,120,0.3); border-radius: 10px;
  font-size: 13px; font-family: inherit; outline: none;
  background: rgba(255,255,255,0.7); color: #5a4a42;
}
.gf-custom-tag-row button {
  padding: 6px 14px; border-radius: 10px;
  border: 1px solid rgba(184,149,120,0.3);
  background: transparent; color: #8a6a5e;
  font-size: 14px; cursor: pointer; font-family: inherit;
}
.gf-custom-tag-row button:hover { background: #b8a090; color: #fff; }
.gf-tag-btn .tag-remove {
  margin-left: 4px; cursor: pointer; opacity: 0.5;
}
.gf-tag-btn .tag-remove:hover { opacity: 1; }

#gl-form-save, #gl-tags-save {
  background: #b8a090 !important;
  color: #fff !important; border-color: #b8a090 !important;
}

/* Export button */
.export-btn {
  width: 24px; height: 24px;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-muted);
  font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.export-btn:hover { background: var(--border); color: var(--text); }

/* ===== Artifacts ===== */

#view-artifacts { display: flex; flex-direction: column; background: #f0ebe4; }

.artifacts-gallery {
  flex: 1; overflow-y: auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 16px;
  align-content: start;
}

.artifact-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.artifact-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.ac-thumb {
  width: 100%; aspect-ratio: 4/3;
  overflow: hidden; position: relative;
  background: linear-gradient(135deg, #f8f5f0, #efe8df);
}
.ac-thumb iframe {
  position: absolute; top: 0; left: 0;
  width: 640px; height: 480px;
  transform: scale(0.242);
  transform-origin: top left;
  border: none; pointer-events: none;
}

.ac-info { padding: 10px 12px; }
.ac-title {
  font-size: 13px; font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ac-desc {
  font-size: 11px; color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.ac-meta {
  font-size: 10px; color: var(--text-muted);
  margin-top: 4px; opacity: 0.7;
}

.artifacts-empty {
  grid-column: 1 / -1;
  text-align: center; color: var(--text-muted);
  padding: 60px 20px; font-size: 14px;
}

/* Artifact detail */
#artifact-detail {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--bg);
}
#artifact-detail.hidden { display: none !important; }

.artifact-frame { flex: 1; border: none; width: 100%; background: #fff; }

/* Artifact edit */
#artifact-edit {
  position: fixed; inset: 0; z-index: 45;
  display: flex; flex-direction: column;
  background: var(--bg);
}
#artifact-edit.hidden { display: none !important; }

.artifact-edit-body {
  padding: 16px; flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
}
.artifact-edit-body label {
  font-size: 13px; font-weight: 600;
}
.artifact-edit-body input, .artifact-edit-body textarea {
  padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 12px;
  font-size: 14px; font-family: inherit; outline: none;
  background: var(--assistant-bubble); color: var(--text);
}
.artifact-edit-body textarea { resize: vertical; line-height: 1.5; }
#ae-code { font-family: "SF Mono","Menlo","Consolas",monospace; font-size: 12px; }
#ae-save {
  background: var(--accent) !important;
  color: #fff !important; border-color: var(--accent) !important;
}

/* Conv artifacts badge & dropdown */
.conv-artifacts-btn {
  font-size: 10px; padding: 1px 8px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: transparent; color: var(--accent);
  cursor: pointer; font-family: inherit;
  white-space: nowrap; margin-left: 6px;
}
.conv-artifacts-btn:hover { background: var(--accent); color: #fff; }

.conv-artifacts-list {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 6px 16px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.conv-artifacts-list.hidden { display: none; }

.cal-item {
  font-size: 12px; padding: 4px 10px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer; color: var(--text);
}
.cal-item:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Memory ===== */

#view-memory { display: flex; flex-direction: column; }

.memory-frame {
  flex: 1; border: none; width: 100%;
}

/* ===== Piggybank ===== */

#view-piggybank { display: flex; flex-direction: column; }

.piggy-body {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 20px;
}

.piggy-hero {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end;
  width: 200px; height: 180px;
  margin-bottom: 8px;
}

.piggy-sparkle {
  position: absolute;
  font-size: 12px;
  opacity: 0;
  animation: sparkle-up 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sparkle-up {
  0% { opacity: 0; transform: translateY(0) scale(0.4); }
  15% { opacity: 1; transform: translateY(-12px) scale(1); }
  60% { opacity: 0.7; transform: translateY(-45px) scale(0.9); }
  100% { opacity: 0; transform: translateY(-65px) scale(0.3); }
}

.piggy-eggplant {
  width: 70px; height: 100px;
  filter: drop-shadow(0 4px 10px rgba(94, 61, 88, 0.3));
  animation: egg-float 3.5s ease-in-out infinite;
  z-index: 1;
  margin-bottom: -4px;
}

.egg-svg { width: 100%; height: 100%; }

@keyframes egg-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.piggy-pedestal {
  width: 80px; height: 12px;
  background: linear-gradient(180deg, #d4b44a 0%, #c9a030 40%, #b08828 100%);
  border-radius: 50%;
  box-shadow:
    0 2px 10px rgba(201, 160, 48, 0.4),
    0 0 20px rgba(201, 160, 48, 0.15),
    inset 0 1px 2px rgba(255, 230, 140, 0.5);
  position: relative;
  z-index: 0;
}

.piggy-target-name {
  font-size: 13px; color: var(--text-muted);
  letter-spacing: 0.5px; margin-bottom: 20px;
}

.piggy-progress-section {
  width: 100%; max-width: 280px;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; margin-bottom: 28px;
}

.piggy-amount {
  display: flex; align-items: baseline; gap: 4px;
}
.piggy-balance {
  font-size: 28px; font-weight: 700;
  color: var(--text);
}
.piggy-sep { font-size: 16px; color: var(--text-muted); }
.piggy-goal { font-size: 16px; color: var(--text-muted); }

.piggy-bar {
  width: 100%; height: 6px;
  background: var(--border);
  border-radius: 3px; overflow: hidden;
}
.piggy-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), #c9a050);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.piggy-pct {
  font-size: 12px; color: var(--text-muted);
}

.piggy-list-header {
  width: 100%; max-width: 400px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

#piggy-list {
  width: 100%; max-width: 400px;
}

.piggy-item {
  border-bottom: 1px solid var(--border);
}

.pi-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 4px;
  cursor: pointer; transition: background 0.15s;
}
.pi-header:hover { background: var(--thinking-bg); }

.pi-amount {
  font-size: 15px; font-weight: 600; min-width: 60px;
}
.pi-amount.income { color: #5a9e6f; }
.pi-amount.expense { color: #c96b6b; }

.pi-note {
  flex: 1; font-size: 14px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pi-date { font-size: 12px; color: var(--text-muted); }
.pi-arrow {
  font-size: 12px; color: var(--text-muted);
  transition: transform 0.2s;
}
.piggy-item.open .pi-arrow { transform: rotate(90deg); }

.pi-body {
  display: none;
  padding: 0 8px 12px;
}
.piggy-item.open .pi-body { display: block; }

.pi-detail {
  font-size: 14px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  padding: 10px 12px;
  background: var(--assistant-bubble);
  border-radius: 10px;
  color: var(--text);
}
.pi-detail.empty { color: var(--text-muted); font-style: italic; }

.pi-actions {
  display: flex; gap: 6px; margin-top: 6px;
  justify-content: flex-end;
}
.pi-actions button {
  padding: 4px 12px; border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 12px; font-family: inherit;
  cursor: pointer; background: transparent; color: var(--text-muted);
}
.pi-actions button:hover { background: var(--border); color: var(--text); }
.pi-actions .pi-del { color: var(--text-muted); }
.pi-actions .pi-del:hover { color: #e25555; border-color: #e25555; background: transparent; }

/* Piggybank form */
#piggy-form {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--bg);
}
#piggy-form.hidden { display: none !important; }

.piggy-form-body {
  padding: 20px; flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.piggy-form-body label {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.piggy-form-body input, .piggy-form-body textarea {
  padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 12px;
  font-size: 14px; font-family: inherit; outline: none;
  background: var(--assistant-bubble); color: var(--text);
}
.piggy-form-body textarea { resize: vertical; line-height: 1.5; }

#piggy-form-save {
  background: var(--accent) !important;
  color: #fff !important; border-color: var(--accent) !important;
}

/* ===== Writings ===== */

#view-writings {
  display: flex; flex-direction: column;
}

.back-sm {
  width: 30px; height: 30px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); font-size: 14px;
  cursor: pointer; color: var(--text-muted);
}

#writings-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--header-bg);
}

#writings-tabs .tab {
  flex: 1; padding: 10px;
  border: none; background: none;
  font-size: 13px; font-family: inherit;
  cursor: pointer; color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

#writings-tabs .tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

#writings-list {
  flex: 1; overflow-y: auto; padding: 8px 16px;
}

.writing-item {
  border-bottom: 1px solid var(--border);
}

.wi-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 8px;
  cursor: pointer; transition: background 0.15s;
}
.wi-header:hover { background: var(--thinking-bg); }

.wi-title { font-size: 14px; flex: 1; }
.wi-date { font-size: 12px; color: var(--text-muted); margin-right: 8px; }
.wi-arrow {
  font-size: 12px; color: var(--text-muted);
  transition: transform 0.2s;
}
.writing-item.open .wi-arrow { transform: rotate(90deg); }

.wi-body {
  display: none;
  padding: 0 12px 12px;
}
.writing-item.open .wi-body { display: block; }

.wi-content {
  font-size: 14px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
  padding: 12px;
  background: var(--assistant-bubble);
  border-radius: 10px;
  max-height: 400px; overflow-y: auto;
}

.wi-content-edit {
  width: 100%; min-height: 200px;
  padding: 12px; font-size: 14px; line-height: 1.6;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  border: 1px solid var(--accent); border-radius: 10px;
  outline: none; resize: vertical;
  background: var(--bg); color: var(--text);
}

.wi-actions {
  display: flex; gap: 6px; margin-top: 8px;
  justify-content: flex-end;
}

.wi-actions button {
  padding: 5px 12px; border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 12px; font-family: inherit;
  cursor: pointer; background: transparent; color: var(--text);
}

.wi-actions .wi-save {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.wi-actions .wi-del { color: var(--text-muted); }
.wi-actions .wi-del:hover { color: #e25555; border-color: #e25555; }

/* Guidelines panel */
#guidelines-panel {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--bg);
}
#guidelines-panel.hidden { display: none !important; }

#guidelines-save {
  background: var(--accent) !important;
  color: #fff !important; border-color: var(--accent) !important;
}

#guidelines-fields { padding: 16px; flex: 1; overflow-y: auto; }

.guideline-group { margin-bottom: 16px; }
.guideline-group label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 4px;
}
.guideline-group textarea {
  width: 100%; height: 100px; padding: 8px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; outline: none;
  resize: vertical; background: var(--assistant-bubble);
}

.empty-state {
  text-align: center; color: var(--text-muted);
  padding: 40px 16px; font-size: 14px;
}

/* ===== Chat & common ===== */

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* --- Sidebar --- */

#overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 20;
  transition: opacity 0.2s;
}
#overlay.hidden { display: none; }

#sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  z-index: 30;
  display: flex; flex-direction: column;
  transform: translateX(0);
  transition: transform 0.2s ease;
  border-right: 1px solid var(--border);
}
#sidebar.hidden { transform: translateX(calc(-1 * var(--sidebar-w))); }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  font-weight: 600; font-size: 15px;
  border-bottom: 1px solid var(--border);
}

#sidebar-new {
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 14px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
}
#sidebar-new:hover { background: var(--accent); color: #fff; }

#conv-list {
  flex: 1; overflow-y: auto;
  list-style: none;
  padding: 8px 0;
}

.conv-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
  gap: 8px;
}
.conv-item:hover { background: var(--border); }
.conv-item.active { background: var(--accent); color: #fff; }

.conv-item .conv-name {
  flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

.conv-item .conv-delete {
  opacity: 0; font-size: 16px;
  background: none; border: none;
  cursor: pointer; color: inherit;
  flex-shrink: 0;
}
.conv-item:hover .conv-delete { opacity: 0.5; }
.conv-item:hover .conv-delete:hover { opacity: 1; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

#edit-proactive, #edit-keywords, #edit-claude-md {
  width: 100%; padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 13px; font-family: inherit;
  cursor: pointer; color: var(--text-muted);
  text-align: left;
}
#edit-proactive:hover, #edit-keywords:hover, #edit-claude-md:hover { background: var(--border); color: var(--text); }

/* --- Proactive Panel --- */

#proactive-panel {
  position: fixed; inset: 0;
  z-index: 40;
  display: flex; flex-direction: column;
  background: var(--bg);
}
#proactive-panel.hidden { display: none; }

#pro-body { flex: 1; overflow-y: auto; padding: 16px; }

.pro-section {
  margin-bottom: 20px;
}
.pro-section label {
  display: block; font-size: 14px; font-weight: 600;
  margin-bottom: 6px;
}
.pro-row {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.pro-row input[type="text"], .pro-row input:not([type]) {
  flex: 1; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 12px;
  font-size: 14px; font-family: inherit; outline: none;
  background: var(--assistant-bubble);
}
.pro-num {
  width: 50px; padding: 6px 8px; text-align: center;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none;
  background: var(--assistant-bubble);
}
.pro-hint {
  font-size: 12px; color: var(--text-muted); margin-top: 4px;
}
.pro-row span { font-size: 13px; color: var(--text-muted); }
#pro-test {
  padding: 6px 14px; border-radius: 10px;
  border: 1px solid var(--accent); font-size: 13px;
  font-family: inherit; cursor: pointer;
  background: transparent; color: var(--accent);
}
#pro-test:hover { background: var(--accent); color: #fff; }
.pro-sched-item {
  font-size: 13px; padding: 6px 0;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.sidebar-footer { display: flex; flex-direction: column; gap: 6px; }

/* --- Keywords Panel --- */

#keywords-panel {
  position: fixed; inset: 0;
  z-index: 40;
  display: flex; flex-direction: column;
  background: var(--bg);
}
#keywords-panel.hidden { display: none; }

#kw-body {
  flex: 1; overflow-y: auto;
  padding: 16px;
}

.kw-section-title {
  font-size: 14px; font-weight: 600;
  margin: 12px 0 8px; color: var(--text);
}

#kw-new-list, #kw-current {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px;
}

.kw-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 13px;
  background: var(--assistant-bubble);
  border: 1px solid var(--border);
  cursor: default;
}

.kw-tag .kw-remove {
  cursor: pointer; font-size: 14px;
  color: var(--text-muted); margin-left: 2px;
}
.kw-tag .kw-remove:hover { color: #e25555; }

.kw-new-tag {
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 13px;
  border: 1px solid var(--accent);
  background: transparent;
  cursor: pointer; color: var(--text);
}
.kw-new-tag.selected { background: var(--accent); color: #fff; }

.kw-add-row {
  display: flex; gap: 8px; margin-top: 12px;
}

.kw-add-row input {
  flex: 1; padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px; font-size: 14px;
  font-family: inherit; outline: none;
  background: var(--assistant-bubble);
}

.kw-add-row button, #kw-add-checked, #kw-sync {
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  font-size: 13px; font-family: inherit;
  cursor: pointer; background: transparent;
  color: var(--accent);
}
.kw-add-row button:hover, #kw-add-checked:hover, #kw-sync:hover {
  background: var(--accent); color: #fff;
}

/* --- Editor Panel --- */

#editor-panel {
  position: fixed; inset: 0;
  z-index: 40;
  display: flex; flex-direction: column;
  background: var(--bg);
}
#editor-panel.hidden { display: none; }

.editor-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 15px;
}

.editor-actions { display: flex; gap: 8px; }

.editor-actions button {
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 13px; font-family: inherit;
  cursor: pointer; background: transparent;
  color: var(--text);
}

.editor-wc {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
}

#editor-save {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}
#editor-save:hover { opacity: 0.85; }
#editor-close:hover { background: var(--border); }

#editor-content {
  flex: 1; padding: 16px;
  font-size: 14px; line-height: 1.6;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  border: none; outline: none;
  resize: none; background: var(--bg);
  color: var(--text);
  -webkit-overflow-scrolling: touch;
}

/* --- App Layout --- */

#app {
  display: flex; flex-direction: column;
  height: 100%; max-width: 720px; margin: 0 auto;
}

/* --- Header --- */

#header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}

#back-btn, #menu-btn {
  width: 34px; height: 34px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg);
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
#back-btn:hover, #menu-btn:hover { background: var(--border); }

.header-center { flex: 1; min-width: 0; }

.header-top-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
}

.title { font-size: 16px; font-weight: 600; white-space: nowrap; }

.selectors { display: flex; gap: 6px; }

.selectors select {
  font-size: 12px; font-family: inherit;
  padding: 3px 6px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
  cursor: pointer; outline: none;
}

.context-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 5px;
}

#context-bar {
  flex: 1; height: 4px;
  background: var(--border);
  border-radius: 2px; overflow: hidden;
}

#context-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
}
#context-fill.warn { background: #e6a23c; }
#context-fill.danger { background: #e25555; }

#context-label { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* --- Chat --- */

#chat {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.message {
  max-width: 80%; padding: 10px 14px;
  border-radius: 18px; line-height: 1.55;
  font-size: 15px; white-space: pre-wrap;
  word-break: break-word;
}
.message.user {
  align-self: flex-end;
  background: var(--user-bubble);
  border-bottom-right-radius: 4px;
}
.message.assistant {
  align-self: flex-start;
  background: var(--assistant-bubble);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.thinking-block {
  align-self: flex-start; max-width: 80%;
  animation: fadeIn 0.2s ease;
}
.thinking-block summary {
  font-size: 13px; color: var(--text-muted);
  cursor: pointer; padding: 4px 0; user-select: none;
}
.thinking-block .thinking-content {
  background: var(--thinking-bg);
  border-radius: 12px; padding: 10px 14px;
  margin-top: 4px; font-size: 13px;
  line-height: 1.5; color: var(--text-muted);
  white-space: pre-wrap; word-break: break-word;
  max-height: 300px; overflow-y: auto;
}

.msg-time {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 6px;
  margin-top: 1px;
  opacity: 0.6;
}

.date-divider {
  text-align: center;
  margin: 8px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.date-divider span {
  background: var(--bg);
  padding: 2px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.msg-group {
  display: flex; flex-direction: column;
  animation: fadeIn 0.2s ease;
}
.msg-group.user { align-items: flex-end; }
.msg-group.assistant { align-items: flex-start; }

.msg-actions {
  display: flex; gap: 4px;
  margin-top: 2px; padding: 0 4px;
  opacity: 0; transition: opacity 0.15s;
}
.msg-group:hover .msg-actions { opacity: 1; }

@media (hover: none) {
  .msg-actions { opacity: 0.6; }
}

.msg-actions button {
  font-size: 12px; padding: 2px 6px;
  border: none; background: none;
  color: var(--text-muted); cursor: pointer;
  border-radius: 4px; font-family: inherit;
}
.msg-actions button:hover { background: var(--border); color: var(--text); }
.bmk-saved {
  color: #e88a9a !important;
  font-size: 13px !important;
}

#stop-btn {
  width: 36px; height: 36px;
  border-radius: 50%; border: 2px solid #e25555;
  background: transparent; color: #e25555;
  font-size: 14px; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#stop-btn.visible { display: flex; }

.chat-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding-top: 30vh;
}
.mini-ty {
  width: 44px; height: 44px;
  animation: ty-bounce 0.6s ease infinite;
}
.chat-loading-text {
  font-size: 13px; color: var(--text-muted);
  letter-spacing: 1px;
  animation: pulse 1.5s ease-in-out infinite;
}

.loading-indicator {
  align-self: flex-start; padding: 10px 14px;
  font-size: 14px; color: var(--text-muted);
  animation: pulse 1.5s ease-in-out infinite;
}

/* --- Input --- */

#input-bar {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--header-bg);
  border-top: 1px solid var(--border);
}

#input {
  flex: 1; border: 1px solid var(--border);
  border-radius: 20px; padding: 10px 16px;
  font-size: 15px; font-family: inherit;
  resize: none; outline: none;
  max-height: 120px; line-height: 1.4;
  background: var(--bg);
  transition: border-color 0.2s;
}
#input:focus { border-color: var(--accent); }

#send {
  width: 36px; height: 36px;
  border-radius: 50%; border: none;
  background: var(--accent); color: #fff;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: opacity 0.2s;
}
#send:disabled { opacity: 0.4; cursor: not-allowed; }
#send:hover:not(:disabled) { opacity: 0.85; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@media (max-width: 720px) {
  #app { max-width: 100%; }
}
