/* ── RESET & ROOT ─────────────────────────────────────────── */
:root {
  --bg: #080510; --surface: #12101a; --surface2: #1a1726; --border: #2a2640;
  --amber: #f5a623; --text: #f0ede8; --text-dim: #888; --text-muted: #555;
  --green: #4caf50; --orange: #ff6b35; --red: #e53e3e; --blue: #4a9eff;
  --radius: 16px; --radius-sm: 10px;
  /* character theme vars — defaults to adie */
  --char-color: #d090f0;
  --char-orb-1: #d090f0; --char-orb-2: #8030c0;
  --accent: #f0d060;
  --char-pulse: rgba(180,100,220,0.7);
  --char-msg-color: rgba(220,185,255,0.88);
  --char-msg-font: 'Playfair Display', Georgia, serif;
  --char-msg-weight: 400; --char-msg-style: italic;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; color: var(--text); font-family: 'DM Sans', Georgia, sans-serif; overflow: hidden; font-size: 20px; }
body { background: #080510; }

/* ── CHARACTER THEMES ─────────────────────────────────────── */
#app { transition: background 1.6s ease; }

#app.theme-adie {
  background: radial-gradient(ellipse at top left, #1a0f2e 0%, #080510 100%);
  --char-color:#d090f0; --char-orb-1:#d090f0; --char-orb-2:#8030c0;
  --char-pulse:rgba(180,100,220,0.7); --char-msg-color:rgba(220,185,255,0.88);
  --char-msg-font:'Playfair Display',Georgia,serif; --char-msg-weight:400; --char-msg-style:italic;
}
#app.theme-faye {
  background: radial-gradient(ellipse at top right, #111008 0%, #090806 100%);
  --char-color:#f0d060; --char-orb-1:#f0d060; --char-orb-2:#a07818;
  --char-pulse:rgba(200,160,50,0.7); --char-msg-color:rgba(245,220,130,0.92);
  --char-msg-font:'Playfair Display',Georgia,serif; --char-msg-weight:600; --char-msg-style:normal;
}
#app.theme-oli {
  background: radial-gradient(ellipse at top center, #100608 0%, #080505 100%);
  --char-color:#e06060; --char-orb-1:#e06060; --char-orb-2:#880020;
  --char-pulse:rgba(200,60,60,0.7); --char-msg-color:rgba(255,185,165,0.85);
  --char-msg-font:'DM Sans',sans-serif; --char-msg-weight:300; --char-msg-style:normal;
}
#app.theme-dre {
  background: radial-gradient(ellipse at top right, #08080f 0%, #050508 100%);
  --char-color:#6080ff; --char-orb-1:#6080ff; --char-orb-2:#1830cc;
  --char-pulse:rgba(80,120,255,0.7); --char-msg-color:rgba(160,180,255,0.88);
  --char-msg-font:'Space Mono',monospace; --char-msg-weight:400; --char-msg-style:normal;
}
#app.theme-q {
  background: radial-gradient(ellipse at top left, #080f18 0%, #050810 100%);
  --char-color:#5090e0; --char-orb-1:#5090e0; --char-orb-2:#1040a0;
  --char-pulse:rgba(60,110,220,0.7); --char-msg-color:rgba(160,200,255,0.88);
  --char-msg-font:'DM Sans',sans-serif; --char-msg-weight:300; --char-msg-style:normal;
}

/* ── AMBIENT ORBS ─────────────────────────────────────────── */
.ambient-orb {
  position: absolute; border-radius: 50%; pointer-events: none;
  filter: blur(90px); opacity: 0.18; z-index: 0;
  background: radial-gradient(circle, var(--char-orb-1), var(--char-orb-2));
}
.orb-a { width: 320px; height: 320px; top: -80px; right: -80px; animation: orbDrift1 18s ease-in-out infinite alternate; }
.orb-b { width: 260px; height: 260px; bottom: 160px; left: -80px; animation: orbDrift2 23s ease-in-out infinite alternate; }
@keyframes orbDrift1 { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(-24px,38px) scale(1.09); } }
@keyframes orbDrift2 { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(38px,-26px) scale(0.94); } }

/* ── AUTH ─────────────────────────────────────────────────── */
#auth-screen { position: fixed; inset: 0; background: radial-gradient(ellipse at top left, #1a0f2e, #040208); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; z-index: 1000; }
.auth-logo { font-size: 3rem; margin-bottom: 0.5rem; }
.auth-title { font-size: 2rem; color: #d090f0; letter-spacing: -0.03em; margin-bottom: 0.25rem; font-family: 'Playfair Display', Georgia, serif; }
.auth-sub { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 2.5rem; font-style: italic; }
.auth-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 380px; backdrop-filter: blur(20px); }
.auth-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.auth-tab { flex: 1; padding: 0.6rem; border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); background: transparent; color: var(--text-dim); font-family: 'DM Sans', sans-serif; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; }
.auth-tab.active { background: #d090f0; color: #000; border-color: #d090f0; font-weight: bold; }
.auth-field { margin-bottom: 1rem; }
.auth-field label { display: block; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.4rem; }
.auth-field input { width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius-sm); padding: 0.75rem 1rem; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 1rem; outline: none; transition: border-color 0.2s; }
.auth-field input:focus { border-color: #d090f0; }
.auth-btn { width: 100%; padding: 0.875rem; background: #d090f0; color: #000; border: none; border-radius: var(--radius-sm); font-family: 'DM Sans', sans-serif; font-size: 1rem; font-weight: bold; cursor: pointer; transition: opacity 0.2s; margin-top: 0.5rem; }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-error { color: var(--red); font-size: 0.85rem; margin-top: 0.75rem; text-align: center; min-height: 1.2em; }
.auth-confirm { background: rgba(76,175,80,0.1); border: 1px solid var(--green); border-radius: var(--radius-sm); padding: 1rem; color: var(--green); font-size: 0.9rem; text-align: center; margin-top: 1rem; display: none; }

/* ── APP ──────────────────────────────────────────────────── */
#app { display: none; flex-direction: column; height: 100vh; max-width: 480px; margin: 0 auto; position: relative; overflow: hidden; }

/* ── HEADER ───────────────────────────────────────────────── */
.app-header { padding: calc(env(safe-area-inset-top, 0px) + 0.75rem) 1rem 0.5rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; background: transparent; position: relative; z-index: 5; }
.header-left { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; font-size: 1rem; cursor: pointer; transition: all 0.3s; overflow: hidden; }
.header-name { display: none; }
.header-sub { font-size: 0.7rem; color: var(--text-dim); font-family: 'DM Sans', sans-serif; }
.char-indicator { font-size: 0.62rem; color: var(--char-color); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.25rem; transition: color 0.4s; font-family: 'DM Sans', sans-serif; font-weight: 500; opacity: 0.8; }
.header-right { display: flex; align-items: center; gap: 0.5rem; }
.logout-btn { background: none; border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); padding: 0.25rem 0.5rem; color: rgba(255,255,255,0.3); font-family: 'DM Sans', sans-serif; font-size: 0.68rem; cursor: pointer; transition: all 0.2s; }
.logout-btn:hover { border-color: var(--red); color: var(--red); }

/* ── CHAR SWITCHER ────────────────────────────────────────── */
.char-switcher { display: flex; gap: 0.3rem; align-items: center; }
.char-pill { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.06); border: 1.5px solid transparent; font-size: 0.95rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.25s; padding: 0; }
.char-pill.active { border-color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.12); }
.char-pill:hover:not(.disabled):not(.active) { background: rgba(255,255,255,0.1); }
.char-pill.disabled { opacity: 0.25; cursor: default; }

/* ── VOICE BAR ────────────────────────────────────────────── */
.voice-bar { padding: 0.25rem 1rem; display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.04); flex-shrink: 0; background: rgba(255,255,255,0.02); }
.voice-indicator { font-size: 0.65rem; color: #555; font-family: 'DM Sans', sans-serif; letter-spacing: 0.02em; }

/* ── ORB SECTION ──────────────────────────────────────────── */
.orb-section { flex: 1; display: flex; flex-direction: column; align-items: center; overflow: hidden; position: relative; }

/* ── ORB ZONE ─────────────────────────────────────────────── */
.orb-zone { display: flex; flex-direction: column; align-items: center; padding-top: 1.75rem; flex-shrink: 0; position: relative; z-index: 2; }
.orb-wrapper { position: relative; width: 112px; height: 112px; display: flex; align-items: center; justify-content: center; }
.orb-ambient-glow { position: absolute; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, var(--char-orb-1) 0%, transparent 65%); opacity: 0.22; top: 50%; left: 50%; transform: translate(-50%,-50%); pointer-events: none; z-index: 0; transition: background 1.6s ease; }
.orb-pulse { position: absolute; border-radius: 50%; border: 1.5px solid var(--char-pulse); width: 112px; height: 112px; top: 50%; left: 50%; transform: translate(-50%,-50%); animation: orbPulse 2.7s ease-out infinite; pointer-events: none; z-index: 1; transition: border-color 1.6s ease; }
.orb-pulse.ring-2 { animation-delay: 0.9s; }
.orb-pulse.ring-3 { animation-delay: 1.8s; }
@keyframes orbPulse { 0% { width:112px;height:112px;opacity:0.85; } 100% { width:200px;height:200px;opacity:0; } }
.orb-circle { width: 112px; height: 112px; border-radius: 50%; background: linear-gradient(135deg, var(--char-orb-1), var(--char-orb-2)); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; z-index: 2; animation: orbFloat 7s ease-in-out infinite; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: background 1.6s ease; flex-shrink: 0; }
@keyframes orbFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.orb-icon { display: flex; align-items: center; justify-content: center; pointer-events: none; }
.orb-ready-dot { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: #4caf50; bottom: 5px; right: 5px; border: 2px solid rgba(0,0,0,0.5); z-index: 3; animation: readyPulse 2.2s ease-in-out infinite; }
@keyframes readyPulse { 0%,100% { transform:scale(1);opacity:1; } 50% { transform:scale(1.35);opacity:0.65; } }
.orb-char-name { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.35); margin-top: 0.8rem; font-family: 'DM Sans', sans-serif; font-weight: 400; }
#triage-pill { display:none; margin-top:0.45rem; padding:0.18rem 0.6rem; border-radius:2rem; background:var(--char-color,#d090f0); color:#0d0d0d; font-size:0.65rem; letter-spacing:0.1em; text-transform:uppercase; font-family:'DM Sans',sans-serif; font-weight:700; opacity:0; transition:opacity 0.3s; pointer-events:none; }
#triage-pill.visible { display:inline-block; opacity:0.85; }

/* per-theme orb glow */
#app.theme-adie .orb-circle { box-shadow: 0 8px 40px rgba(208,144,240,0.38); }
#app.theme-faye .orb-circle { box-shadow: 0 8px 40px rgba(240,208,96,0.38); }
#app.theme-oli  .orb-circle { box-shadow: 0 8px 40px rgba(224,96,96,0.38); }
#app.theme-dre  .orb-circle { box-shadow: 0 8px 40px rgba(96,128,255,0.38); }
#app.theme-q    .orb-circle { box-shadow: 0 8px 40px rgba(80,144,224,0.38); }

/* ── LAST MESSAGE ─────────────────────────────────────────── */
.last-message-area { padding: 1rem 2rem 0.5rem; text-align: center; flex-shrink: 0; width: 100%; position: relative; z-index: 2; }
.last-message { font-size: 14px; line-height: 1.65; color: var(--char-msg-color); font-family: var(--char-msg-font); font-weight: var(--char-msg-weight); font-style: var(--char-msg-style); min-height: 2.2em; transition: color 1.6s ease, font-family 0.3s; }
.thread-hint { font-size: 0.68rem; color: rgba(255,255,255,0.2); margin-top: 0.45rem; font-family: 'DM Sans', sans-serif; letter-spacing: 0.06em; cursor: pointer; }
.thread-hint:hover { color: rgba(255,255,255,0.38); }

/* ── ACTIVITY STRIP ───────────────────────────────────────── */
.activity-strip { width: 100%; padding: 0.5rem 1.25rem 0.4rem; flex-shrink: 0; position: relative; z-index: 2; }
.activity-divider { width: 100%; height: 1px; background: rgba(255,255,255,0.05); margin-bottom: 0.55rem; }
.activity-label { font-size: 8px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--char-color); opacity: 0.65; margin-bottom: 0.4rem; font-family: 'DM Sans', sans-serif; font-weight: 500; transition: color 1.6s ease; }
.activity-items { display: flex; flex-direction: column; gap: 0.28rem; }
.activity-item { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; padding: 0.08rem 0; }
.activity-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.activity-dot.state-doing { background: var(--char-color); animation: dotPulse 2.2s ease-in-out infinite; }
.activity-dot.state-urgent { background: var(--orange); animation: dotPulse 1.2s ease-in-out infinite; }
.activity-dot.state-pending { background: rgba(255,255,255,0.28); }
.activity-text { font-size: 0.77rem; color: rgba(255,255,255,0.42); font-family: 'DM Sans', sans-serif; font-weight: 300; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 20px); }
.activity-empty { font-size: 0.74rem; color: rgba(255,255,255,0.22); font-style: italic; font-family: 'DM Sans', sans-serif; }
@keyframes dotPulse { 0%,100% { opacity:1;transform:scale(1); } 50% { opacity:0.45;transform:scale(0.75); } }

/* ── THREAD DRAWER ────────────────────────────────────────── */
.thread-drawer { position: absolute; bottom: 0; left: 0; right: 0; top: 0; background: rgba(4,3,10,0.97); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); border-radius: 20px 20px 0 0; border-top: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.45s cubic-bezier(0.25,0.46,0.45,0.94); z-index: 20; }
.thread-drawer.open { transform: translateY(0); }
.thread-header { padding: 0.9rem 1rem 0.7rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.thread-title { font-size: 0.75rem; color: rgba(255,255,255,0.4); letter-spacing: 0.1em; text-transform: uppercase; font-family: 'DM Sans', sans-serif; }
.thread-close { background: none; border: none; color: rgba(255,255,255,0.35); font-size: 1.05rem; cursor: pointer; padding: 0.25rem; line-height: 1; }
#feed { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; scroll-behavior: smooth; }

/* ── MESSAGES ─────────────────────────────────────────────── */
.msg-wrap { display: flex; flex-direction: column; }
.msg-wrap.user { align-items: flex-end; }
.msg-wrap.adie { align-items: flex-start; }
.msg-label { font-size: 0.62rem; color: var(--text-muted); margin-bottom: 0.2rem; letter-spacing: 0.1em; text-transform: uppercase; font-family: 'DM Sans', sans-serif; }
.msg-bubble { max-width: 85%; padding: 0.75rem 1rem; border-radius: 14px; font-size: 0.93rem; line-height: 1.55; }
.msg-bubble.user { background: rgba(40,30,80,0.55); color: rgba(180,160,255,0.82); border-bottom-right-radius: 4px; border: 1px solid rgba(80,60,120,0.3); }
.msg-bubble.adie { background: rgba(255,255,255,0.05); color: var(--char-msg-color); border-bottom-left-radius: 4px; border: 1px solid rgba(255,255,255,0.08); font-family: var(--char-msg-font); font-weight: var(--char-msg-weight); font-style: var(--char-msg-style); }
.msg-actions { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
.msg-action-btn { background: none; border: none; font-size: 1rem; cursor: pointer; opacity: 0.35; transition: opacity 0.2s; }
.msg-action-btn:hover { opacity: 1; }

/* ── QUICK REPLIES ────────────────────────────────────────── */
.quick-replies { display: flex; gap: 0; align-items: center; overflow-x: auto; padding: 0.35rem 1rem; flex-shrink: 0; scrollbar-width: none; position: relative; z-index: 2; width: 100%; }
.quick-replies::-webkit-scrollbar { display: none; }
.qr-btn { background: none; border: none; padding: 0.25rem 0.5rem; font-family: 'DM Sans', sans-serif; font-size: 0.8rem; color: rgba(255,255,255,0.38); cursor: pointer; white-space: nowrap; transition: color 0.2s; flex-shrink: 0; }
.qr-btn:hover, .qr-btn:active { color: var(--char-color); }
.qr-sep { color: rgba(255,255,255,0.15); font-size: 0.75rem; user-select: none; flex-shrink: 0; }

/* ── INPUT AREA (chips + bar grouped) ────────────────────── */
.input-area { display: flex; flex-direction: column; flex-shrink: 0; }

/* ── INPUT BAR ────────────────────────────────────────────── */
.input-bar { padding: 0.6rem 1rem; display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; background: transparent; }
.mic-btn { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--char-orb-1), var(--char-orb-2)); border: none; font-size: 1.2rem; cursor: pointer; flex-shrink: 0; transition: background 1.6s ease, transform 0.15s; display: flex; align-items: center; justify-content: center; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.mic-btn.listening {
  background: #ff1744 !important;
  animation: pulse 1s infinite;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.85), 0 0 24px rgba(255,23,68,0.6) !important;
  color: #fff !important;
}
.mic-btn.muted {
  background: #f5a623 !important;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.85), 0 0 16px rgba(245,166,35,0.5) !important;
  color: #fff !important;
}
.mic-btn.ptt {
  background: #ff6d00 !important;
  animation: pulse 0.5s infinite;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.85), 0 0 24px rgba(255,109,0,0.6) !important;
  color: #fff !important;
}
@keyframes pulse { 0%,100% { transform:scale(1); } 50% { transform:scale(1.1); } }
.text-input { flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 22px; padding: 0.6rem 1rem; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.93rem; outline: none; resize: none; max-height: 80px; transition: border-color 0.2s; }
.text-input::placeholder { color: rgba(255,255,255,0.25); }
.text-input:focus { border-color: var(--char-color); }
.send-btn { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.7); font-size: 1.1rem; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.send-btn:hover { background: rgba(255,255,255,0.18); }
/* ── INPUT CLEAR BUTTON & EDIT MODE ──────────────────────── */
.text-input-wrap { flex:1; position:relative; display:flex; align-items:stretch; min-width:0; }
.text-input-wrap .text-input { padding-right:2.4rem; }
.task-input-wrap { flex:1; position:relative; display:flex; align-items:center; min-width:0; }
.task-input-wrap .task-add-input { width:100%; padding-right:2rem; }
.input-clear-btn { position:absolute; right:9px; top:50%; transform:translateY(-50%); background:none; border:none; color:rgba(255,255,255,0.35); font-size:1.05rem; cursor:pointer; padding:0.25rem; line-height:1; transition:color 0.15s; -webkit-tap-highlight-color:transparent; z-index:1; }
.input-clear-btn:hover, .input-clear-btn:active { color:rgba(255,255,255,0.65); }
.mic-btn.edit-mode { opacity:0.3 !important; pointer-events:none !important; }
.interrupt-btn {
  display: none; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(220,70,30,0.92); border: 2px solid rgba(255,255,255,0.18);
  color: #fff; font-size: 1.1rem; cursor: pointer; flex-shrink: 0;
  align-items: center; justify-content: center;
  animation: interruptPulse 1.4s ease-in-out infinite;
}
.interrupt-btn.visible { display: flex; }
@keyframes interruptPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(220,70,30,0.5); }
  50% { box-shadow: 0 0 0 10px rgba(220,70,30,0); }
}

/* ── SESSION BAR ──────────────────────────────────────────── */
.session-bar { padding: 0.2rem 1rem 0.35rem; display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; flex-shrink: 0; background: transparent; }
.end-session-btn { flex: 1; padding: 0.45rem; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm); color: rgba(255,255,255,0.3); font-family: 'DM Sans', sans-serif; font-size: 0.75rem; cursor: pointer; transition: all 0.2s; }
.end-session-btn:hover { border-color: var(--char-color); color: var(--char-color); }
.session-action-btn { width: 30px; height: 30px; background: none; border: none; color: rgba(255,255,255,0.2); font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; }
.session-action-btn:hover, .session-action-btn:active { color: rgba(255,255,255,0.5); }
.diag-menu-wrap { position: relative; }
.diag-menu-panel { position: fixed; bottom: calc(env(safe-area-inset-bottom, 20px) + 52px); right: 8px; background: var(--surface); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius-sm); padding: 0.35rem 0; min-width: 168px; box-shadow: 0 -4px 20px rgba(0,0,0,0.55); z-index: 2147483640; }
.diag-menu-overlay { position: fixed; inset: 0; z-index: 99; }
.diag-menu-item { display: block; width: 100%; padding: 0.6rem 0.9rem; background: none; border: none; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.82rem; cursor: pointer; text-align: left; transition: background 0.15s; white-space: nowrap; }
.diag-menu-item:hover, .diag-menu-item:active { background: rgba(255,255,255,0.06); }
/* ── MED CARD CONTEXT MENU ────────────────────────────────── */
.med-card-menu { position: fixed; background: var(--surface); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius); padding: 0.4rem 0; min-width: 185px; box-shadow: 0 8px 28px rgba(0,0,0,0.65); z-index: 300; }
.med-card-menu-overlay { position: fixed; inset: 0; z-index: 299; }
.med-card-menu-item { display: block; width: 100%; padding: 0.65rem 1rem; background: none; border: none; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.88rem; cursor: pointer; text-align: left; transition: background 0.15s; white-space: nowrap; }
.med-card-menu-item:hover, .med-card-menu-item:active { background: rgba(255,255,255,0.06); }
.med-card-menu-item.danger { color: var(--red); }
.med-card-menu-item.sep { border-top: 1px solid rgba(255,255,255,0.08); margin-top: 0.2rem; }
.med-dose-date { font-size: 0.68rem; color: var(--text-muted); margin-bottom: 0.35rem; letter-spacing: 0.04em; }

/* ── TRAY ─────────────────────────────────────────────────── */
.tray { padding: 0.45rem 0.75rem; padding-bottom: calc(0.45rem + env(safe-area-inset-bottom, 0px)); display: flex; gap: 0.2rem; align-items: center; flex-shrink: 0; background: rgba(5,4,12,0.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid rgba(255,255,255,0.06); }
.tray-btn { flex: 1; padding: 0.48rem 0.25rem; display: flex; flex-direction: column; align-items: center; gap: 0.18rem; background: none; border: none; cursor: pointer; color: rgba(255,255,255,0.3); font-family: 'DM Sans', sans-serif; font-size: 0.58rem; font-weight: 400; border-radius: 10px; transition: all 0.2s; letter-spacing: 0.03em; }
.tray-btn.active { color: rgba(255,255,255,0.92); background: rgba(255,255,255,0.1); }
.tray-icon { font-size: 1.15rem; }

/* ── PANELS ───────────────────────────────────────────────── */
.panel { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.panel.active { display: flex; }
.panel-header { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.panel-title { font-size: 1.05rem; color: var(--char-color); transition: color 0.4s; font-family: 'DM Sans', sans-serif; font-weight: 500; }
.panel-close { background: none; border: none; color: var(--text-dim); font-size: 1.2rem; cursor: pointer; }
.panel-body { flex: 1; overflow-y: auto; padding: 1rem; }

/* ── TASKS ────────────────────────────────────────────────── */
.task-tabs { display:flex; background:rgba(0,0,0,0.15); flex-shrink:0; }
.task-tab-btn { flex:1; padding:0.55rem 0; background:none; border:none; border-bottom:2px solid transparent; color:var(--text-muted); font-family:'DM Sans',sans-serif; font-size:0.72rem; cursor:pointer; transition:all 0.2s; text-transform:uppercase; letter-spacing:0.05em; }
.task-tab-btn.active { color:var(--char-color); border-bottom-color:var(--char-color); }

/* ── MEDICATIONS ──────────────────────────────────────────── */
.med-status-dot { width:10px; height:10px; border-radius:50%; border:none; cursor:pointer; flex-shrink:0; padding:0; transition:all 0.3s; }
.med-status-dot.state-none { display:none!important; }
.med-status-dot.state-med-overdue { background:var(--red); animation:pulse 1s infinite; }
.med-status-dot.state-med-due { background:#f97316; }
.med-status-dot.state-task { background:var(--amber); }
.med-status-dot.state-cal { background:#3b82f6; }
.med-status-dot.state-green { background:var(--green); opacity:0.6; }
.header-right { position:relative; }
.indicator-popover { position:absolute; top:calc(100% + 8px); right:0; z-index:200; background:var(--surface); border:1px solid rgba(255,255,255,0.12); border-radius:var(--radius); padding:0.75rem; min-width:220px; max-width:280px; box-shadow:0 8px 24px rgba(0,0,0,0.5); }
.indicator-popover-overlay { position:fixed; inset:0; z-index:199; }
.indicator-popover-item { display:flex; align-items:flex-start; gap:0.6rem; padding:0.5rem 0; border-bottom:1px solid rgba(255,255,255,0.07); }
.indicator-popover-item:last-child { border-bottom:none; padding-bottom:0; }
.indicator-popover-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; margin-top:0.3rem; }
.indicator-popover-text { flex:1; font-size:0.8rem; }
.ip-title { color:var(--text); font-weight:500; }
.ip-sub { color:var(--text-muted); font-size:0.72rem; margin-top:0.1rem; }
.indicator-popover-actions { display:flex; gap:0.35rem; flex-wrap:wrap; margin-top:0.4rem; }
.indicator-popover-actions button { padding:0.2rem 0.55rem; border-radius:2rem; border:none; font-size:0.68rem; font-family:'DM Sans',sans-serif; cursor:pointer; transition:all 0.2s; }
.ip-btn-confirm { background:rgba(80,200,120,0.2); color:var(--green); }
.ip-btn-skip { background:rgba(255,255,255,0.08); color:var(--text-muted); }
.ip-btn-snooze { background:rgba(255,200,0,0.15); color:var(--amber); }
.ip-btn-nav { background:rgba(255,255,255,0.08); color:var(--text-muted); }
.med-dose-card { background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.1); border-radius:var(--radius-sm); padding:0.75rem; margin-bottom:0.5rem; -webkit-user-select:none; user-select:none; touch-action:manipulation; transition:transform 0.15s ease, border-color 0.15s ease; }
.med-dose-card.pressing { transform:scale(1.03); border-color:var(--char-color) !important; }
.meds-manage-section { margin-top:1.25rem; border-top:1px solid rgba(255,255,255,0.07); padding-top:0.75rem; }
.med-dose-card.med-confirmed { border-left:3px solid var(--green); opacity:0.5; }
.med-dose-card.med-confirmed .med-dose-actions { display:none !important; }
.med-dose-card.med-confirmed .med-dose-overdue-warning { display:none !important; }
.med-dose-card.med-skipped { border-left:3px solid rgba(255,255,255,0.15); opacity:0.5; }
.med-dose-card.med-skipped .med-dose-actions { display:none !important; }
.med-dose-card.med-overdue { border-left:3px solid var(--red); }
.med-dose-card.med-due { border-left:3px solid var(--amber); }
.med-dose-card.med-snoozed { border-left:3px solid rgba(255,200,0,0.4); opacity:0.7; }
.med-dose-card.med-pending { border-left:3px solid rgba(255,255,255,0.15); }
.med-dose-header { display:flex; justify-content:space-between; align-items:flex-start; gap:0.5rem; }
.med-dose-name { font-size:0.92rem; font-weight:500; font-family:'DM Sans',sans-serif; }
.med-dose-amount { font-size:0.75rem; color:var(--text-muted); margin-top:0.15rem; }
.med-dose-time { font-size:0.75rem; color:var(--text-muted); flex-shrink:0; }
.med-dose-notes { font-size:0.72rem; color:var(--text-dim); margin-top:0.35rem; font-style:italic; }
.med-dose-status { font-size:0.72rem; color:var(--text-dim); margin-top:0.25rem; }
.med-dose-status-taken { color:var(--green); font-weight:500; }
.med-dose-status-skipped { color:rgba(255,255,255,0.28); }
.med-dose-status-upcoming { color:#5a8aaa; opacity:0.75; }
.med-dose-status-overdue { color:var(--red); animation:pulse 1.2s ease-in-out infinite; }
.med-dose-status-due { color:var(--amber); }
.med-dose-status-snoozed { color:rgba(255,200,0,0.6); }
.med-dose-actions { display:flex; gap:0.4rem; margin-top:0.6rem; flex-wrap:wrap; }
.med-action-btn { padding:0.3rem 0.65rem; border-radius:2rem; border:none; font-size:0.72rem; font-family:'DM Sans',sans-serif; cursor:pointer; transition:all 0.2s; }
.med-action-btn.take { background:rgba(80,200,120,0.2); color:var(--green); }
.med-action-btn.take:hover { background:rgba(80,200,120,0.35); }
.med-action-btn.skip { background:rgba(255,255,255,0.06); color:var(--text-muted); }
.med-action-btn.skip:hover { background:rgba(255,255,255,0.12); }
.med-action-btn.snooze { background:rgba(255,200,0,0.12); color:var(--amber); }
.med-action-btn.snooze:hover { background:rgba(255,200,0,0.22); }
.med-day-picker { display:flex; gap:0.3rem; flex-wrap:wrap; margin-top:0.4rem; }
.med-day-btn { padding:0.25rem 0.5rem; border-radius:2rem; border:1px solid rgba(255,255,255,0.12); background:none; color:var(--text-muted); font-size:0.7rem; font-family:'DM Sans',sans-serif; cursor:pointer; transition:all 0.2s; }
.med-day-btn.active { background:rgba(var(--char-rgb,120,120,200),0.2); border-color:var(--char-color); color:var(--char-color); }
.med-configured-item { background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08); border-radius:var(--radius-sm); padding:0.65rem 0.9rem; margin-bottom:0.4rem; display:flex; justify-content:space-between; align-items:center; gap:0.5rem; }
.med-config-info { flex:1; min-width:0; }
.med-config-name { font-size:0.88rem; font-weight:500; font-family:'DM Sans',sans-serif; }
.med-config-sub { font-size:0.72rem; color:var(--text-muted); margin-top:0.15rem; }
.med-config-actions { display:flex; gap:0.35rem; flex-shrink:0; }
.med-config-btn { padding:0.25rem 0.55rem; border-radius:2rem; border:1px solid rgba(255,255,255,0.12); background:none; color:var(--text-muted); font-size:0.7rem; cursor:pointer; font-family:'DM Sans',sans-serif; }
.med-config-btn:hover { background:rgba(255,255,255,0.08); }
.med-config-btn.danger { color:var(--red); border-color:rgba(255,80,80,0.2); }
.med-add-form { background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.1); border-radius:var(--radius-sm); padding:0.9rem; margin-top:0.5rem; display:none; }
.med-add-form.open { display:block; }
.med-form-label { font-size:0.7rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.07em; margin-bottom:0.3rem; margin-top:0.6rem; font-family:'DM Sans',sans-serif; }
.med-form-label:first-child { margin-top:0; }
.med-time-chips { display:flex; gap:0.35rem; flex-wrap:wrap; margin-top:0.3rem; }
.med-time-chip { display:flex; align-items:center; gap:0.25rem; background:rgba(var(--char-rgb,120,120,200),0.18); border-radius:2rem; padding:0.2rem 0.55rem; font-size:0.75rem; color:var(--char-color); }
.med-time-chip button { background:none; border:none; color:inherit; cursor:pointer; font-size:0.85rem; line-height:1; padding:0; }
.med-changelog-entry { font-size:0.75rem; color:var(--text-dim); padding:0.35rem 0; border-bottom:1px solid rgba(255,255,255,0.05); font-family:'DM Sans',sans-serif; }
.med-changelog-entry:last-child { border-bottom:none; }
.med-hist-section { margin-bottom:0.75rem; }
.med-hist-med-name { font-size:0.78rem; font-weight:500; color:var(--text); margin-bottom:0.3rem; padding-bottom:0.25rem; border-bottom:1px solid rgba(255,255,255,0.07); font-family:'DM Sans',sans-serif; }
.med-hist-row { display:flex; align-items:center; gap:0.5rem; padding:0.2rem 0; }
.med-hist-date { font-size:0.7rem; color:var(--text-muted); width:56px; flex-shrink:0; font-family:'DM Sans',sans-serif; }
.med-hist-dots { display:flex; gap:0.35rem; align-items:center; }
.med-hist-dot { width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.med-hist-dot.taken { background:var(--green); }
.med-hist-dot.skipped { background:var(--red); opacity:0.65; }
.med-hist-dot.missed { background:rgba(255,255,255,0.14); }
.task-section-label { font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; margin: 0.75rem 0 0.5rem; font-family: 'DM Sans', sans-serif; }
.task-item { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-left:3px solid transparent; border-radius: var(--radius-sm); padding: 0.65rem 0.9rem; margin-bottom: 0.5rem; display: flex; align-items: flex-start; gap: 0.6rem; transition: opacity 0.3s; }
.task-item.pri-urgent { border-left-color: var(--red); }
.task-item.pri-important { border-left-color: var(--amber); }
.task-item.pri-someday { border-left-color: rgba(255,255,255,0.12); }
.task-item.completed { opacity: 0.45; }
.task-type-icon { font-size: 0.8rem; flex-shrink:0; margin-top:0.15rem; opacity:0.65; min-width:16px; text-align:center; }
.task-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.15); background: none; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; transition: all 0.2s; margin-top:0.1rem; }
.task-check:hover { border-color: var(--green); }
.task-check.done { background: var(--green); border-color: var(--green); color: #fff; }
.task-content { flex: 1; min-width: 0; }
.task-text { font-size: 0.88rem; line-height: 1.35; font-family: 'DM Sans', sans-serif; }
.task-meta { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.25rem; display: flex; gap: 0.4rem; align-items: center; flex-wrap:wrap; font-family: 'DM Sans', sans-serif; }
.task-badge { font-size: 0.6rem; padding: 0.1rem 0.35rem; border-radius: 10px; border: 1px solid; }
.task-badge.overdue { color: var(--red); border-color: var(--red); }
.task-badge.urgent { color: var(--red); border-color: var(--red); }
.task-badge.floating { color: var(--text-muted); border-color: rgba(255,255,255,0.1); }
.task-cat-chip { font-size:0.58rem; padding:0.1rem 0.35rem; border-radius:4px; background:rgba(255,255,255,0.07); color:var(--text-muted); text-transform:uppercase; letter-spacing:0.04em; }
.task-waiting-for { font-size:0.7rem; color:var(--text-muted); font-style:italic; margin-top:0.2rem; }
.task-empty-state { color:var(--text-muted); font-style:italic; text-align:center; padding:2rem 0; font-size:0.88rem; font-family:'DM Sans',sans-serif; }
.task-menu-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; padding: 0.25rem; flex-shrink: 0; }
.task-add-row { display: flex; gap: 0.4rem; margin-bottom: 0.6rem; }
.task-type-select { background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1); border-radius:var(--radius-sm); padding:0.5rem 0.35rem; color:var(--text-dim); font-family:'DM Sans',sans-serif; font-size:0.72rem; cursor:pointer; flex-shrink:0; max-width:80px; }
.task-add-input { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.88rem; outline: none; }
.task-add-input:focus { border-color: var(--char-color); }
.task-attach-btn { background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1); border-radius:var(--radius-sm); padding:0.5rem 0.6rem; color:var(--text-dim); cursor:pointer; font-size:0.9rem; flex-shrink:0; display:flex; align-items:center; }
.task-mic-btn { background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1); border-radius:var(--radius-sm); padding:0.5rem 0.6rem; color:var(--text-dim); cursor:pointer; font-size:0.9rem; flex-shrink:0; display:flex; align-items:center; transition:border-color 0.2s,color 0.2s; }
.task-mic-btn.listening { border-color:var(--red); color:var(--red); animation:pulse 1s infinite; }
.task-add-btn { background: var(--char-color); border: none; border-radius: var(--radius-sm); padding: 0.6rem 0.9rem; color: #000; font-family: 'DM Sans', sans-serif; font-size: 0.82rem; font-weight: bold; cursor: pointer; transition: background 1.6s ease; flex-shrink:0; }
.completed-actions { display:flex; gap:0.35rem; flex-shrink:0; flex-direction:column; align-items:flex-end; }
.completed-act-btn { background:none; border:1px solid rgba(255,255,255,0.1); border-radius:4px; color:var(--text-muted); font-size:0.68rem; padding:0.2rem 0.45rem; cursor:pointer; font-family:'DM Sans',sans-serif; white-space:nowrap; }
.completed-act-btn:hover { background:rgba(255,255,255,0.07); color:var(--text); }
.doc-extract-banner { background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.1); border-radius:var(--radius-sm); padding:0.75rem; margin-bottom:0.75rem; font-size:0.82rem; color:var(--text-dim); line-height:1.5; }
.doc-extract-banner b { color:var(--text); }
/* ── BATCH SELECT ─────────────────────────────────────────── */
.task-select-bar { display:none; padding:0.38rem 1rem; background:rgba(0,0,0,0.15); border-bottom:1px solid rgba(255,255,255,0.05); align-items:center; justify-content:space-between; flex-shrink:0; gap:0.5rem; }
.task-select-bar.visible { display:flex; }
.select-count-label { font-size:0.78rem; color:var(--text-muted); font-family:'DM Sans',sans-serif; }
.select-all-btn { background:none; border:none; color:var(--char-color); font-family:'DM Sans',sans-serif; font-size:0.78rem; cursor:pointer; padding:0; }
.task-batch-actions { display:none; padding:0.5rem 1rem; gap:0.4rem; background:rgba(8,5,16,0.96); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); border-top:1px solid rgba(255,255,255,0.08); flex-shrink:0; }
.task-batch-actions.visible { display:flex; }
.batch-action-btn { flex:1; padding:0.5rem 0.25rem; border-radius:var(--radius-sm); border:1px solid rgba(255,255,255,0.1); background:none; color:var(--text-muted); font-family:'DM Sans',sans-serif; font-size:0.72rem; cursor:pointer; transition:all 0.15s; }
.batch-action-btn:hover,.batch-action-btn:active { background:rgba(255,255,255,0.06); color:var(--text); }
.batch-action-btn.danger { color:var(--red); border-color:rgba(255,80,80,0.18); }
.task-item.task-selected { background:rgba(255,255,255,0.08)!important; border-left-color:var(--char-color)!important; border-color:rgba(255,255,255,0.18)!important; }
.task-select-check { width:20px; height:20px; border-radius:4px; border:1.5px solid rgba(255,255,255,0.2); background:none; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:0.75rem; cursor:pointer; margin-top:0.1rem; transition:all 0.15s; }
.task-select-check.checked { background:var(--char-color); border-color:var(--char-color); color:#000; }
.select-mode-btn { padding:0.28rem 0.6rem; border-radius:var(--radius-sm); border:1px solid rgba(255,255,255,0.18); background:rgba(255,255,255,0.05); color:var(--text-dim); font-family:'DM Sans',sans-serif; font-size:0.72rem; cursor:pointer; transition:all 0.2s; }
.select-mode-btn.active { border-color:var(--char-color); color:var(--char-color); background:rgba(255,255,255,0.06); }

/* ── SWIPE GESTURES ───────────────────────────────────────── */
.task-swipe-wrapper { position:relative; overflow:hidden; border-radius:var(--radius-sm); margin-bottom:0.5rem; touch-action:pan-y; }
.task-swipe-wrapper .task-item { margin-bottom:0; border-radius:0; transition:transform 0.22s cubic-bezier(0.25,0.46,0.45,0.94); will-change:transform; }
.task-swipe-wrapper .task-item.swiping { transition:none; }
.task-swipe-tray { position:absolute; right:0; top:0; bottom:0; display:flex; align-items:stretch; }
.swipe-tray-btn { width:56px; border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:1.3rem; opacity:0; pointer-events:none; transition:opacity 0.15s; }
.task-swipe-wrapper.tray-open .swipe-tray-btn { opacity:1; pointer-events:auto; }
.swipe-tray-btn.tray-incubator { background:rgba(145,120,210,0.9); }
.swipe-tray-btn.tray-active { background:rgba(80,140,255,0.9); }
.swipe-tray-btn.tray-done { background:rgba(76,175,80,0.9); }
.swipe-tray-btn.tray-delete { background:rgba(220,55,55,0.9); }
.swipe-tray-btn.tray-resurrect { background:rgba(80,140,255,0.9); }
.task-swipe-wrapper.undo-pending .task-item { opacity:0.35; pointer-events:none; }
@keyframes searchPulse { 0%,100% { box-shadow:0 0 0 0 var(--char-color); } 50% { box-shadow:0 0 0 6px rgba(0,0,0,0); outline-color:var(--char-color); } }
.search-highlight > .task-item { animation:searchPulse 0.65s ease-in-out 3; outline:1px solid var(--char-color); outline-offset:-1px; }

/* ── SORT ROW ─────────────────────────────────────────────── */
.tab-sort-row { display:none; padding:0.22rem 1rem; background:rgba(0,0,0,0.08); border-bottom:1px solid rgba(255,255,255,0.04); align-items:center; gap:0.3rem; overflow-x:auto; scrollbar-width:none; flex-shrink:0; }
.tab-sort-row.visible { display:flex; }
.tab-sort-row::-webkit-scrollbar { display:none; }
.tab-sort-label { font-size:0.6rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.08em; white-space:nowrap; flex-shrink:0; opacity:0.6; }
.tab-sort-btn { padding:0.16rem 0.5rem; border-radius:2rem; border:1px solid rgba(255,255,255,0.07); background:none; color:var(--text-muted); font-family:'DM Sans',sans-serif; font-size:0.65rem; cursor:pointer; white-space:nowrap; flex-shrink:0; transition:all 0.15s; }
.tab-sort-btn.active { border-color:var(--char-color); color:var(--char-color); background:rgba(255,255,255,0.03); }

/* ── CALENDAR ─────────────────────────────────────────────── */
.cal-day-group { font-size:0.72rem; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; padding:0.65rem 0 0.3rem; border-top:1px solid rgba(255,255,255,0.05); margin-top:0.25rem; }
.cal-day-group:first-child { border-top:none; margin-top:0; padding-top:0; }
.cal-event-card { background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08); border-left:3px solid var(--char-color); border-radius:var(--radius-sm); padding:0.6rem 0.85rem; margin-bottom:0.4rem; display:flex; align-items:center; gap:0.6rem; }
.cal-event-time { font-size:0.72rem; color:var(--text-muted); flex-shrink:0; min-width:80px; }
.cal-event-title { font-size:0.88rem; color:var(--text); flex:1; }
.cal-day-popup { background:var(--surface); border:1px solid rgba(255,255,255,0.12); border-radius:var(--radius); padding:1rem; margin-top:0.75rem; }
/* Month grid */
.cal-month-header { display:flex; align-items:center; justify-content:center; gap:0.6rem; margin-bottom:0.5rem; }
.cal-month-label { font-size:0.9rem; font-weight:600; color:var(--text); min-width:130px; text-align:center; }
.cal-month-nav-btn { background:none; border:none; color:var(--text-dim); font-size:1rem; cursor:pointer; padding:0.2rem 0.45rem; border-radius:4px; line-height:1; }
.cal-month-nav-btn:hover, .cal-month-nav-btn:active { background:rgba(255,255,255,0.08); color:var(--text); }
.cal-month-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.cal-month-dow { font-size:0.62rem; color:var(--text-muted); text-align:center; padding:0.25rem 0; }
.cal-month-cell { font-size:0.78rem; color:var(--text-dim); text-align:center; padding:0.35rem 0; border-radius:4px; cursor:pointer; position:relative; min-height:28px; }
.cal-month-cell:hover { background:rgba(255,255,255,0.06); }
.cal-month-cell.today { background:rgba(255,255,255,0.12); color:var(--text); font-weight:700; }
.cal-month-cell.has-event { color:var(--text); }
.cal-month-cell.empty { cursor:default; }
.cal-month-dot { display:block; width:4px; height:4px; background:var(--char-color); border-radius:50%; margin:2px auto 0; }
/* Vault */
.vault-lock { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:3rem 1.5rem; text-align:center; }
.vault-lock p { font-size:0.88rem; color:var(--text-muted); max-width:260px; line-height:1.6; margin-bottom:1.5rem; }
/* legacy — kept for backward compat */
.completed-toggle { display:none; }
#completed-section { display:none; }

/* ── CONTEXT MENU ─────────────────────────────────────────── */
.ctx-menu { position: fixed; background: rgba(20,16,32,0.97); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius); padding: 0.5rem 0; z-index: 999; box-shadow: 0 8px 40px rgba(0,0,0,0.7); min-width: 190px; backdrop-filter: blur(20px); }
.ctx-item { padding: 0.75rem 1.25rem; font-family: 'DM Sans', sans-serif; font-size: 0.88rem; cursor: pointer; color: var(--text); transition: background 0.15s; }
.ctx-item:hover { background: rgba(255,255,255,0.07); }
.ctx-item.danger { color: var(--red); }
.ctx-item.success { color: var(--green); }
.ctx-overlay { position: fixed; inset: 0; z-index: 998; }

/* ── BOTTOM SHEET MENU ─────────────────────────────────────── */
.bsheet-overlay { position: fixed; inset: 0; z-index: 998; background: rgba(0,0,0,0.45); }
.bsheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 999; background: rgba(20,16,32,0.97); border-radius: var(--radius) var(--radius) 0 0; border-top: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(20px); max-height: 75vh; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.32,0.72,0,1); }
.bsheet.visible { transform: translateY(0); }
.bsheet-handle { width: 100%; height: 1.5rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: grab; touch-action: none; }
.bsheet-handle::after { content: ''; display: block; width: 36px; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; }
.bsheet-title { padding: 0.75rem 1.25rem 0.4rem; font-family: 'DM Sans', sans-serif; font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.07em; flex-shrink: 0; }
.bsheet-scroll { overflow-y: auto; flex: 1; padding-bottom: 0.5rem; }
.bsheet-item { padding: 0.85rem 1.25rem; font-family: 'DM Sans', sans-serif; font-size: 0.92rem; cursor: pointer; color: var(--text); transition: background 0.15s; }
.bsheet-item:active { background: rgba(255,255,255,0.07); }
.bsheet-item.danger { color: var(--red); }
.bsheet-item.success { color: var(--green); }
.bsheet-item.muted { color: var(--text-dim); }
.bsheet-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 0.25rem 0; }

/* ── CHARACTER CARDS (Settings) ───────────────────────────── */
.char-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.char-card { background: rgba(255,255,255,0.04); border: 2px solid rgba(255,255,255,0.08); border-radius: var(--radius); padding: 1rem; cursor: pointer; transition: all 0.2s; text-align: center; position: relative; }
.char-card.selected { border-color: var(--char-color); }
.char-card:hover { border-color: rgba(255,255,255,0.25); }
.char-card-avatar { font-size: 2rem; margin-bottom: 0.4rem; }
.char-card-name { font-size: 0.88rem; color: var(--text); font-weight: 500; margin-bottom: 0.2rem; font-family: 'DM Sans', sans-serif; }
.char-card-desc { font-size: 0.7rem; color: var(--text-dim); line-height: 1.3; font-family: 'DM Sans', sans-serif; }
.char-card-coming { position: absolute; top: 0.4rem; right: 0.4rem; font-size: 0.58rem; background: rgba(255,255,255,0.06); color: var(--text-muted); padding: 0.1rem 0.4rem; border-radius: 10px; }
.char-name-edit { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.char-name-input { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); padding: 0.4rem 0.6rem; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.8rem; outline: none; }
.char-name-input:focus { border-color: var(--char-color); }
.char-name-save { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); padding: 0.4rem 0.6rem; color: var(--text-dim); font-family: 'DM Sans', sans-serif; font-size: 0.8rem; cursor: pointer; }
.char-name-save:hover { border-color: var(--char-color); color: var(--char-color); }
.faye-star { display: inline-block; }
.faye-star svg { width: 32px; height: 32px; }

/* ── SETTINGS ─────────────────────────────────────────────── */
.intensity-row { display: flex; align-items: center; gap: 0.75rem; margin: 0.5rem 0; }
.slider-input { flex: 1; accent-color: var(--char-color); }
.settings-section { margin-bottom: 1.5rem; }
.settings-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem; font-family: 'DM Sans', sans-serif; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 0.88rem; font-family: 'DM Sans', sans-serif; }
.settings-row-sub { font-size: 0.73rem; color: var(--text-dim); margin-top: 0.1rem; font-family: 'DM Sans', sans-serif; }
.toggle-switch { width: 44px; height: 24px; border-radius: 12px; background: rgba(255,255,255,0.1); border: none; cursor: pointer; position: relative; transition: background 0.2s; flex-shrink: 0; }
.toggle-switch.on { background: var(--char-color); }
.toggle-switch::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: left 0.2s; }
.toggle-switch.on::after { left: 23px; }
.settings-btn { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); padding: 0.5rem 1rem; color: var(--text-dim); font-family: 'DM Sans', sans-serif; font-size: 0.85rem; cursor: pointer; transition: all 0.2s; }
.settings-btn:hover { border-color: var(--char-color); color: var(--char-color); }
.settings-btn.connected { border-color: var(--green); color: var(--green); }
.settings-btn.danger { border-color: var(--red); color: var(--red); }
.google-status { font-size: 0.73rem; color: var(--text-dim); margin-top: 0.4rem; font-family: 'DM Sans', sans-serif; }
.accordion-header { display:flex; align-items:center; justify-content:space-between; cursor:pointer; user-select:none; -webkit-user-select:none; padding:0.25rem 0; }
.accordion-header .settings-label { margin-bottom:0; }
.accordion-chevron { font-size:1.1rem; color:var(--text-muted); transition:transform 0.22s; display:inline-block; line-height:1; }
.accordion-chevron.open { transform:rotate(90deg); }
.mode-seg { display:flex; gap:0.4rem; margin-top:0.5rem; }
.mode-seg-btn { flex:1; padding:0.5rem 0.25rem; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1); border-radius:var(--radius-sm); color:var(--text-dim); font-family:'DM Sans',sans-serif; font-size:0.8rem; cursor:pointer; transition:all 0.18s; text-align:center; }
.mode-seg-btn.active { background:rgba(255,255,255,0.10); border-color:var(--char-color); color:var(--char-color); }
.google-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.vocab-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.vocab-tag { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 0.25rem 0.6rem; font-size: 0.78rem; color: var(--text-dim); display: flex; align-items: center; gap: 0.4rem; font-family: 'DM Sans', sans-serif; }
.vocab-tag .remove-tag { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.9rem; }
.vocab-tag .remove-tag:hover { color: var(--red); }
.vocab-input-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.vocab-input { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.85rem; outline: none; }
.vocab-input:focus { border-color: var(--char-color); }
.vocab-add-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; color: var(--text-dim); font-family: 'DM Sans', sans-serif; font-size: 0.85rem; cursor: pointer; }
.vocab-add-btn:hover { border-color: var(--char-color); color: var(--char-color); }
.med-item { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin-bottom: 0.5rem; display: flex; align-items: center; justify-content: space-between; }
.med-btn { background: var(--char-color); border: none; border-radius: var(--radius-sm); padding: 0.4rem 0.75rem; color: #000; font-family: 'DM Sans', sans-serif; font-size: 0.8rem; font-weight: bold; cursor: pointer; transition: background 1.6s ease; }
.med-btn.taken { background: var(--green); color: #fff; }
.memory-block { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 0.75rem; }
.memory-block h4 { font-size: 0.78rem; color: var(--char-color); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.08em; font-family: 'DM Sans', sans-serif; transition: color 0.4s; }
.memory-block p { font-size: 0.84rem; color: var(--text-dim); line-height: 1.55; white-space: pre-wrap; font-family: 'DM Sans', sans-serif; }

/* ── TYPING ───────────────────────────────────────────────── */
.typing-indicator { display: flex; gap: 4px; align-items: center; padding: 0.75rem 1rem; }
.typing-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--char-color); animation: tbounce 1s infinite; transition: background 1.6s ease; }
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes tbounce { 0%,60%,100% { transform:translateY(0); } 30% { transform:translateY(-6px); } }

/* ── CONFETTI ─────────────────────────────────────────────── */
.confetti-piece { position: fixed; width: 10px; height: 10px; top: -10px; border-radius: 2px; animation: cfall 2.5s linear forwards; z-index: 9999; pointer-events: none; }
@keyframes cfall { 0% { transform:translateY(0) rotate(0deg);opacity:1; } 100% { transform:translateY(100vh) rotate(720deg);opacity:0; } }

/* ── TOAST ────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(20,16,32,0.95); border: 1px solid var(--char-color); border-radius: var(--radius-sm); padding: 0.6rem 1.25rem; font-size: 0.84rem; color: var(--char-color); z-index: 9998; opacity: 0; transition: all 0.3s; pointer-events: none; white-space: nowrap; font-family: 'DM Sans', sans-serif; backdrop-filter: blur(16px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#action-toast { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 50%; transform: translateX(-50%) translateY(-50px); background: rgba(20,16,32,0.96); border: 1px solid var(--char-color); border-radius: 2rem; padding: 0.4rem 1rem; font-size: 0.78rem; color: var(--char-color); z-index: 9999; opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none; white-space: nowrap; font-family: 'DM Sans', sans-serif; backdrop-filter: blur(16px); }
#action-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.tray-btn.flash { animation: trayFlash 0.7s ease; }
@keyframes trayFlash { 0%,100%{transform:scale(1);color:rgba(255,255,255,0.3)} 40%{transform:scale(1.2);color:var(--char-color)} }

/* ── MISC ─────────────────────────────────────────────────── */
.recurring-badge { font-size: 0.62rem; color: var(--blue); border: 1px solid var(--blue); padding: 0.1rem 0.4rem; border-radius: 10px; }
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
/* Settling state — neutral dim render until loadSettings runs and applies the right character.
   Prevents the "kneejerk" flash of Adie before the saved character loads. */
body:not(.settled) #app {
  filter: grayscale(0.4) brightness(0.85);
  opacity: 0.6;
  transition: none;
}
body.settled #app {
  opacity: 1;
  filter: none;
  transition: opacity 0.5s ease, filter 0.5s ease;
}
/* ===== End Session Ceremony ===== */
.ceremony-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,4,18,0.96);
  z-index: 9990;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  opacity: 0;
  transition: opacity 0.6s ease;
  font-family: 'DM Sans', sans-serif;
}
.ceremony-overlay.visible { opacity: 1; }

.ceremony-orb-wrap {
  margin-bottom: 2rem;
  opacity: 0.85;
  animation: ceremonyExhale 4s ease-in-out infinite;
}
@keyframes ceremonyExhale {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(0.96); opacity: 1; }
}

.ceremony-closing-line {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--char-color, #f0d060);
  text-align: center;
  line-height: 1.4;
  max-width: 80%;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.ceremony-closing-line.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── FOCUS TIMER ──────────────────────────────────────────── */
.focus-overlay { position: fixed; inset: 0; background: rgba(4,3,12,0.98); z-index: 8000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; transition: opacity 0.4s; }
.focus-overlay.hidden { display: none; }
.focus-mode-label { position: absolute; top: calc(env(safe-area-inset-top,0px) + 1.2rem); left: 50%; transform: translateX(-50%); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--text-muted); font-family: 'DM Sans', sans-serif; }
.focus-timer-ring { width: 220px; height: 220px; position: relative; margin-bottom: 1.5rem; flex-shrink: 0; }
.focus-timer-svg { transform: rotate(-90deg); position: absolute; inset: 0; }
.focus-timer-track { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 6; }
.focus-timer-progress { fill: none; stroke: var(--char-color); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke 1.6s ease; }
.focus-countdown { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.focus-time-display { font-size: 3.2rem; font-weight: 300; letter-spacing: -0.02em; color: var(--text); line-height: 1; font-family: 'DM Sans', sans-serif; }
.focus-time-sublabel { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.12em; margin-top: 0.5rem; font-family: 'DM Sans', sans-serif; }
.focus-task-label { font-size: 0.88rem; color: var(--text-muted); text-align: center; margin-bottom: 2rem; max-width: 280px; line-height: 1.5; font-style: italic; font-family: 'Playfair Display', serif; min-height: 1.5em; }
.focus-actions { display: flex; gap: 0.75rem; }
.focus-end-btn { padding: 0.7rem 1.75rem; border-radius: 2rem; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.05); color: var(--text-muted); font-family: 'DM Sans', sans-serif; font-size: 0.88rem; cursor: pointer; transition: all 0.2s; }
.focus-end-btn:hover { border-color: var(--red); color: var(--red); }
.focus-done-btn { padding: 0.7rem 1.75rem; border-radius: 2rem; border: none; background: var(--char-color); color: #000; font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: background 1.6s ease; }
.focus-streak-pill { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.7rem; color: var(--amber); background: rgba(245,166,35,0.1); border: 1px solid rgba(245,166,35,0.22); border-radius: 2rem; padding: 0.18rem 0.5rem; cursor: pointer; transition: all 0.2s; flex-shrink: 0; }
.focus-streak-pill:hover { background: rgba(245,166,35,0.18); }
.focus-streak-pill.hidden { display: none; }
.focus-preset-chip { padding: 0.28rem 0.65rem; border-radius: 20px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); font-size: 0.73rem; cursor: pointer; font-family: 'DM Sans', sans-serif; white-space: nowrap; transition: background 0.15s; }
.focus-preset-chip:active { background: rgba(255,255,255,0.13); }
.focus-dur-picker { display: flex; gap: 0.45rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1.5rem; }
.focus-dur-btn { padding: 0.5rem 1rem; border-radius: 2rem; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); color: var(--text-muted); font-family: 'DM Sans', sans-serif; font-size: 0.82rem; cursor: pointer; transition: all 0.2s; }
.focus-dur-btn:hover, .focus-dur-btn.sel { border-color: var(--char-color); color: var(--char-color); background: rgba(255,255,255,0.08); }
.focus-start-btn { padding: 0.7rem 2rem; border-radius: 2rem; border: none; background: var(--char-color); color: #000; font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background 1.6s ease; }
.focus-panel-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); margin-bottom: 0.75rem; }
.focus-panel-label { font-size: 0.82rem; color: var(--text-muted); flex: 1; font-family: 'DM Sans', sans-serif; }
.focus-panel-btn { padding: 0.4rem 0.85rem; border-radius: 2rem; border: 1px solid rgba(255,255,255,0.12); background: none; color: var(--char-color); font-family: 'DM Sans', sans-serif; font-size: 0.78rem; cursor: pointer; transition: all 0.2s; }
.focus-panel-btn:hover { background: rgba(255,255,255,0.07); }
/* Soft block */
.focus-soft-block { position: fixed; inset: 0; background: rgba(4,3,12,0.93); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); z-index: 9000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; text-align: center; font-family: 'DM Sans', sans-serif; }
.focus-soft-block.hidden { display: none; }
.focus-soft-msg { font-size: 1.15rem; color: var(--char-color); font-family: 'Playfair Display', serif; font-style: italic; margin-bottom: 0.6rem; }
.focus-soft-sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 2rem; line-height: 1.5; }
.focus-soft-actions { display: flex; gap: 0.75rem; }
.focus-soft-continue { padding: 0.65rem 1.5rem; border-radius: 2rem; border: none; background: var(--char-color); color: #000; font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: background 1.6s ease; }
.focus-soft-leave { padding: 0.65rem 1.5rem; border-radius: 2rem; border: 1px solid rgba(255,255,255,0.12); background: none; color: var(--text-muted); font-family: 'DM Sans', sans-serif; font-size: 0.88rem; cursor: pointer; }

.ceremony-recap {
  width: 100%;
  max-width: 360px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.ceremony-recap.visible {
  opacity: 1;
  transform: translateY(0);
}
.ceremony-recap-header {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 2rem;
  color: var(--char-color, #fff);
  text-align: center;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}
.ceremony-recap-body {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
  text-align: left;
  white-space: pre-wrap;
  overflow-y: auto;
  max-height: 260px;
}
.ceremony-recap-show-more {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  text-align: center;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  padding: 0.25rem 0;
  width: 100%;
}
.ceremony-recap-show-more:hover { color: rgba(255,255,255,0.7); }

.ceremony-saved {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.ceremony-saved.visible { opacity: 1; }

.ceremony-btns {
  display: flex;
  gap: 0.75rem;
  margin-top: 2.5rem;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.ceremony-btns.visible { opacity: 1; }
.ceremony-open-btn {
  padding: 0.75rem 1.5rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease;
}
.ceremony-open-btn:hover, .ceremony-open-btn:active { background: rgba(255,255,255,0.1); }
.ceremony-close-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  color: rgba(255,255,255,0.4);
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s ease;
}
.ceremony-close-btn:hover { color: rgba(255,255,255,0.7); }
.ceremony-session-saved {
  margin-top: 1.25rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
  text-align: center;
  letter-spacing: 0.04em;
  font-family: 'DM Sans', sans-serif;
}
.settings-attribution {
  text-align: center; font-size: 11px;
  color: rgba(255,255,255,0.22);
  font-family: 'DM Sans', sans-serif;
  padding: 1.5rem 0 0.5rem;
  letter-spacing: 0.04em;
}

/* ── SPLASH SCREEN ─────────────────────────────────────── */
#splash-screen {
  position: fixed; inset: 0; z-index: 99999;
  background: #080510;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
  user-select: none; -webkit-user-select: none;
  overflow: hidden;
}
#splash-screen.fade-out { opacity: 0; pointer-events: none; }
@keyframes splashFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes splashWelcomeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Entry orb: full-screen canvas behind character icons */
#entry-orb-canvas {
  position: absolute; inset: 0;
  display: block; touch-action: none; z-index: 0;
  width: 100%; height: 100%;
}
/* Welcome greeting — absolute, upper third */
#entry-welcome {
  position: absolute; z-index: 1;
  top: max(env(safe-area-inset-top, 0px) + 2.5rem, 3rem);
  left: 0; right: 0;
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: 2.6rem;
  text-align: center;
  opacity: 0; animation: splashWelcomeIn 0.6s ease forwards 0.3s;
}
#entry-wordmark {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-bottom: 0;
  opacity: 0; animation: splashFadeIn 0.5s ease forwards 0.15s;
}
.entry-h-mark { display: block; }
.entry-handle-text {
  font-family: 'Playfair Display', serif; font-style: normal; font-weight: 400;
  font-size: 16px; letter-spacing: 4px; color: #f0d060;
}
#entry-char-row {
  position: absolute; z-index: 1;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 5.5rem);
  left: 0; right: 0;
  display: flex; flex-direction: row;
  gap: 1.8rem;
  justify-content: center;
  opacity: 0; animation: splashFadeIn 0.5s ease forwards 0.5s;
}
.entry-char-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.45rem;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.entry-char-avatar-wrap {
  width: 66px; height: 66px; border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 2px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.22s, box-shadow 0.22s;
}
.entry-char-item.active .entry-char-avatar-wrap {
  border-color: var(--entry-char-color, #d090f0);
  box-shadow: 0 0 20px var(--entry-char-color, #d090f0),
              0 0 6px var(--entry-char-color, #d090f0);
}
.entry-char-name-label {
  font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  transition: color 0.22s;
  font-family: 'DM Sans', sans-serif; font-weight: 500;
}
.entry-char-item.active .entry-char-name-label {
  color: var(--entry-char-color, #d090f0);
}
/* Bottom ambient shortcuts — pinned to screen bottom */
#entry-shortcuts {
  position: absolute; z-index: 1;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1.75rem);
  left: 0; right: 0;
  display: flex; gap: 2.2rem; justify-content: center;
  opacity: 0; animation: splashFadeIn 0.5s ease forwards 0.75s;
}
.entry-shortcut {
  display: flex; flex-direction: column; align-items: center; gap: 0.28rem;
  background: none; border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; padding: 0.25rem;
}
.entry-shortcut-icon { font-size: 1.1rem; opacity: 0.55; display: block; }
.entry-shortcut-label {
  font-size: 12px; color: #555;
  font-family: 'DM Sans', sans-serif; font-weight: 400;
}

/* ── BELLY ZONES ────────────────────────────────────────── */
.belly-zone {
  width: 100%; flex-shrink: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.belly-handled {
  padding: 0.4rem 1.25rem 0.3rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.belly-handled-label {
  font-family: 'Playfair Display', serif;
  font-size: 0.75rem; font-weight: 700;
  color: var(--char-color);
  opacity: 0.75;
  letter-spacing: 0.12em;
  margin-bottom: 0.3rem;
  transition: color 1.6s ease;
}
.belly-handled-items {
  display: flex; flex-direction: column; gap: 0.3rem;
  max-height: 90px; overflow-y: auto; scrollbar-width: none;
  padding-bottom: 0.2rem;
}
.belly-handled-items::-webkit-scrollbar { display: none; }
.belly-handled-chip {
  width: 100%;
  padding: 0.28rem 0.65rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  display: flex; align-items: center; gap: 0.35rem;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.belly-handled-chip:active { background: rgba(255,255,255,0.11); }
.belly-handled-chip::before { content: '✓'; color: rgba(255,255,255,0.35); flex-shrink: 0; }
.belly-handles {
  padding: 0.4rem 1.25rem 0.3rem;
}
.belly-handles-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem; font-weight: 500;
  color: var(--char-color);
  opacity: 0.65;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  transition: color 1.6s ease;
}
.belly-handles-items {
  display: flex; flex-direction: column; gap: 0.3rem;
  max-height: 90px; overflow-y: auto; scrollbar-width: none;
}
.belly-handles-items::-webkit-scrollbar { display: none; }
.belly-session-pill {
  padding: 0.1rem 1.25rem 0.35rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.62rem;
  color: var(--char-color);
  opacity: 0.4;
  letter-spacing: 0.03em;
  transition: color 1.6s ease;
}
.belly-handle-chip {
  width: 100%;
  padding: 0.28rem 0.65rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.belly-handle-chip:active { background: rgba(255,255,255,0.09); }

.ceremony-loading-dots::after {
  content: '...';
  display: inline-block;
  animation: dotsBlink 1.4s infinite;
}
@keyframes dotsBlink {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}
#settings-pull-indicator {
  height: 0; overflow: hidden; opacity: 0; text-align: center;
  font-size: 0.72rem; color: var(--text-muted); font-family: 'DM Sans', sans-serif;
  display: flex; align-items: center; justify-content: center;
  transition: height 0.15s, opacity 0.15s;
}
.entry-tap-hint {
  position: absolute; z-index: 1;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 3.1rem);
  left: 0; right: 0; text-align: center;
  font-size: 0.6rem; color: rgba(255,255,255,0.18);
  font-family: 'DM Sans', sans-serif; letter-spacing: 0.2em; text-transform: uppercase;
  opacity: 0; animation: splashFadeIn 0.5s ease forwards 0.7s;
}

/* ─── Meds panel layout ──────────────────────────────────────────────── */
.panel-body.meds-mode { overflow: hidden !important; display: flex; flex-direction: column; }
#meds-panel { display: flex; flex-direction: column; overflow: hidden; flex: 1; min-height: 0; }
#meds-dose-list { flex: 1; min-height: 0; overflow-y: scroll; -webkit-overflow-scrolling: touch; }
.meds-manage-section { flex-shrink: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; max-height: 40vh; border-top: 1px solid rgba(255,255,255,0.07); }
