/* Same palette as Coco Bot: near-black background, grey assistant, blue user bubbles, amber accent. */
:root {
  --bg: #141414; --surface: #1f1f1f; --surface-2: #2a2a2a; --line: #333; --bubble: #262626;
  --text: #f5f5f5; --muted: #8e8e93; --blue: #2f64c8; --blue-2: #3b74e0; --ok: #34a853; --bad: #e5484d;
  --accent: #f5a524; --fs: 18px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Arabic", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: var(--fs)/1.6 var(--font); }
.hidden { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:active { transform: scale(.96); }
.muted { color: var(--muted); }
.primary { background: var(--blue); color: #fff; border-radius: 18px; padding: 13px 18px; font-weight: 700; }
.err { color: #ff8f8f; min-height: 1em; margin: 0; font-size: 15px; }
.circle { position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid #3a3a3a; flex: none; font-size: 20px; }
.circle.sm { width: 38px; height: 38px; font-size: 16px; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--accent); color: #111; font-size: 12px; font-weight: 800; display: grid; place-items: center; }

/* login */
.screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.card { width: min(400px, 100%); text-align: center; display: flex; flex-direction: column; gap: 12px; }
.card .hero { width: 100%; max-width: 340px; margin: 0 auto; border-radius: 24px; box-shadow: 0 8px 30px rgba(0,0,0,.45); }
.card h1 { margin: 4px 0 0; font-size: 30px; }
.card input { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; text-align: center; }

/* main */
.pane { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.top { display: flex; align-items: center; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid #222; background: linear-gradient(180deg, #181818, var(--bg)); }
.top .av { width: 48px; height: 48px; border-radius: 50%; border: 2px solid #f0cd0e; object-fit: cover; }
.hello { flex: 1; min-width: 0; }
.hello .h1 { font-size: 22px; font-weight: 800; line-height: 1.2; }
.hello .h2 { font-size: 14px; color: var(--muted); }
#msgs { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.bubble { max-width: 88%; padding: 11px 16px; border-radius: 22px; overflow-wrap: anywhere; line-height: 1.6; animation: fadeIn .2s ease-out; }
.bubble.boss { align-self: flex-end; background: linear-gradient(160deg, var(--blue-2), var(--blue)); color: #fff; border-end-end-radius: 6px; white-space: pre-wrap; }
.bubble.fatih { align-self: flex-start; background: var(--bubble); border-end-start-radius: 6px; }
.bubble.owner { align-self: flex-start; background: #2b2414; border: 1px solid #5a4614; border-end-start-radius: 6px; }
.bubble.error { background: #2a1517; border: 1px solid #4a2124; }
.bubble .who { display: block; font-size: 13px; font-weight: 800; color: var(--accent); margin-bottom: 2px; }
.bubble p { margin: 0 0 .5em; } .bubble p:last-child { margin: 0; }
.bubble ul, .bubble ol { margin: .2em 0 .5em; padding-inline-start: 1.3em; }
.bubble .time { display: block; font-size: 11px; opacity: .55; margin-top: 4px; text-align: end; }
.bubble[dir=rtl] { text-align: right; }
.copy { font-size: 12px; color: var(--muted); margin-inline-start: 8px; }
.typing { align-self: flex-start; color: var(--muted); padding: 6px 12px; }
.typing span { display: inline-block; width: 8px; height: 8px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
.empty { margin: auto; text-align: center; color: var(--muted); padding: 20px; }
.empty b { color: var(--text); font-size: 20px; display: block; margin-bottom: 6px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 12px 6px; scrollbar-width: none; flex: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { white-space: nowrap; background: var(--surface); border: 1px solid #383838; border-radius: 999px; padding: 7px 14px; font-size: 15px; }
#composer { padding: 6px 12px max(12px, env(safe-area-inset-bottom)); flex: none; }
.box { display: flex; align-items: flex-end; gap: 6px; background: var(--surface); border: 1px solid #383838; border-radius: 28px; padding: 6px 6px 6px 16px; }
.box textarea { flex: 1; resize: none; border: 0; outline: 0; background: none; max-height: 160px; padding: 9px 0; line-height: 1.4; }
.send { width: 44px; height: 44px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; flex: none; }
.send:disabled { opacity: .4; }
.send svg { width: 24px; height: 24px; }

/* tasks sheet */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; z-index: 10; }
.sheet-card { width: 100%; max-height: 85dvh; overflow-y: auto; background: #1a1a1a; border-radius: 26px 26px 0 0; padding: 16px 16px max(18px, env(safe-area-inset-bottom)); border-top: 1px solid #333; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 20px; }
.task-add { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 14px; }
.task-add input { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; color-scheme: dark; }
.task { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid #262626; }
.task .chk { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #555; flex: none; display: grid; place-items: center; font-size: 15px; }
.task.done .chk { background: var(--ok); border-color: var(--ok); }
.task.done .tx { text-decoration: line-through; color: var(--muted); }
.task .tx { flex: 1; }
.task .due { display: block; font-size: 13px; color: var(--accent); }
.task .del { color: var(--muted); padding: 4px 8px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* conversation switch: Hilal (bot) / Alaa (direct) */
.tabs { display: flex; gap: 8px; padding: 10px 12px 4px; flex: none; }
.tabs button { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 10px;
  border-radius: 999px; background: var(--surface); border: 1px solid #333; font-weight: 700; font-size: 16px; color: var(--muted); }
.tabs button small { font-weight: 400; font-size: 12px; opacity: .8; }
.tabs button img, .tabs .ava { width: 26px; height: 26px; border-radius: 50%; }
.tabs .ava { display: grid; place-items: center; background: #5a4614; color: #ffd76a; font-size: 14px; }
.tabs button.on { color: var(--text); border-color: var(--blue-2); background: #1d2a44; }
.tabs .dot { position: absolute; top: 4px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.alaa-note { margin: auto; text-align: center; color: var(--muted); padding: 20px; }
.alaa-note b { color: var(--text); font-size: 19px; display: block; margin-bottom: 6px; }
