/* Buddy on iPhone: the website's warm look (web/public/style.css, look A), made for a phone in one hand. The head on
   top, the chat (or Claude Code, or Settings) under it, the tabs at the bottom. The notch and the home bar are left
   clear (the safe-area insets: the page runs under them, as viewport-fit=cover asks). */
:root {
  --cream: #FFF5E9;
  --paper: #FFFFFF;
  --ink: #2A1E17;
  --ink-2: #6B5848;
  --line: #F0DCC5;
  --orange: #FFB54C;
  --orange-tint: #FFE6C2;
  --ok-bg: #EAF7EC;
  --ok-ink: #23663A;
  --bad-bg: #FDE8E1;
  --bad-ink: #B0472A;
  --display: "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Mukta", system-ui, -apple-system, sans-serif;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --left: env(safe-area-inset-left, 0px);
  --right: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--cream); color: var(--ink); font: 400 17px/1.45 var(--body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app { display: flex; flex-direction: column; height: 100dvh; padding: var(--top) var(--right) 0 var(--left); }

/* the head */
.stage { position: relative; flex: none; height: 32dvh; min-height: 170px; }
.app[data-signed="out"] .stage { height: 50dvh; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.bubble { position: absolute; left: 50%; bottom: 6px; margin: 0; padding: 5px 14px; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 15px; font-weight: 500; white-space: nowrap; transform: translateX(-50%); }

/* signed out */
.signin { display: grid; gap: 14px; justify-items: center; padding: 0 24px calc(24px + var(--bottom)); text-align: center; }
.signin h1 { margin: 0; font: 800 34px/1.05 var(--display); }
.signin p { margin: 0; max-width: 30ch; color: var(--ink-2); }

/* shared parts */
.pane { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 24px; border: 2px solid transparent; border-radius: 999px; font-weight: 600; }
.btn--ink { background: var(--ink); color: var(--cream); }
.btn--ghost { border-color: var(--ink); background: transparent; }
.btn--sm { padding: 8px 16px; font-size: 15px; }
.icon { display: grid; flex: none; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; font-size: 20px; }
.icon:disabled { opacity: .35; }
.send { background: var(--ink); color: var(--cream); font-weight: 700; }
.mic[aria-pressed="true"] { background: var(--orange); }
.muted { margin: 0; color: var(--ink-2); font-size: 15px; }
.error { margin: 0 12px 8px; padding: 8px 12px; border-radius: 12px; background: var(--bad-bg); color: var(--bad-ink); font-size: 15px; }
.box { display: flex; flex: none; align-items: flex-end; gap: 6px; margin: 0 12px 10px; padding: 5px; border-radius: 26px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
/* 17px: iOS zooms in on a box whose text is under 16px */
.box textarea { flex: 1; min-height: 44px; max-height: 30dvh; padding: 10px 8px; border: 0; outline: none; background: transparent; font-size: 17px; resize: none; }

/* the chat */
.items { display: flex; flex: 1; flex-direction: column; gap: 10px; margin: 0; padding: 8px 14px; overflow-y: auto; list-style: none; }
.items:empty { flex: 0; padding: 0; }
.item { max-width: 88%; padding: 9px 13px; border-radius: 18px; overflow-wrap: anywhere; }
.item p { margin: 0; white-space: pre-wrap; }
.item.you { align-self: flex-end; border-bottom-right-radius: 6px; background: var(--ink); color: var(--cream); }
.item.buddy { align-self: flex-start; border-bottom-left-radius: 6px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.item.buddy .text { padding: 8px 10px; border-radius: 12px; background: var(--cream); }
.item.buddy .say + .text { margin-top: 6px; }
.item .notes { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 15px; }
.item.event { align-self: center; max-width: 100%; padding: 2px 8px; color: var(--ink-2); font-size: 14px; text-align: center; }
.item.error { align-self: flex-start; background: var(--bad-bg); color: var(--bad-ink); }
.item.thinking { align-self: flex-start; padding: 2px 4px; color: var(--ink-2); font-size: 15px; }
.buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.item.event .buttons { justify-content: center; margin-top: 2px; }
.chip { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 15px; font-weight: 600; }
.empty { margin: auto 24px; color: var(--ink-2); text-align: center; }

/* Claude Code, drawn as the Mac panel's Claude mode draws it: as Claude Code's terminal (src/renderer/panel/panel.css
   .panel.cli), monospace, ● ⎿ ❯ and its greens, reds and oranges. Always the Mac's black, in light and dark alike: it is
   the same screen. claude-cli.js says what each row is. */
:root {
  --cli-bg: #000000; --cli-fg: #F2F2F2; --cli-dim: #8C8C8C; --cli-bar: #2C2C2C; --cli-line: #3A3A3A;
  --cli-panel: #0D0D0D; --cli-hover: #1A1A1A;
  --cli-green: #4EBA65; --cli-red: #FF6B80; --cli-orange: #D77757; --cli-blue: #B1B9F9;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
.cli { background: var(--cli-bg); color: var(--cli-fg); font: 13px/1.5 var(--mono); }
.cli .muted { color: var(--cli-dim); font-size: 13px; }
.cli .icon { color: var(--cli-fg); }
.cli .btn--ghost { border: 1px solid var(--cli-line); border-radius: 6px; color: var(--cli-fg); font: inherit; }
.cli .error { margin: 0 16px 8px; border-radius: 6px; background: color-mix(in srgb, var(--cli-red) 15%, transparent); color: var(--cli-red); font-size: 13px; }

/* the sessions, by computer */
.claude-pick { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 12px 16px; overflow-y: auto; }
.claude-pick h2 { margin: 0; font: 700 15px/1.3 var(--mono); }
.settings h2 { margin: 6px 0 0; font: 700 22px/1.1 var(--display); }
.claude-pick .btn { align-self: center; }
.groups { display: grid; gap: 14px; }
.group h3 { margin: 0 0 6px; color: var(--cli-dim); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.sessions { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sessions button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--cli-line); border-radius: 6px; background: var(--cli-panel); color: var(--cli-fg); font: inherit; text-align: left; }
.sessions button:active { background: var(--cli-hover); }
.sessions .name { min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sessions .name .under { display: block; color: var(--cli-dim); font-size: 12px; font-weight: 400; }
.status-chip { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--cli-bar); color: var(--cli-dim); font: 12px/1.6 var(--mono); }
.status-chip.working { background: color-mix(in srgb, var(--cli-orange) 20%, transparent); color: var(--cli-orange); }
.status-chip.waiting, .status-chip.failed { background: color-mix(in srgb, var(--cli-red) 18%, transparent); color: var(--cli-red); }
.status-chip.done { background: color-mix(in srgb, var(--cli-green) 18%, transparent); color: var(--cli-green); }

/* one session */
.claude-session { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.claude-bar { display: flex; flex: none; align-items: center; gap: 4px; padding: 0 8px 4px; border-bottom: 1px solid var(--cli-line); }
.claude-bar .grow { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.claude-items { display: flex; flex: 1; flex-direction: column; gap: 12px; margin: 0; padding: 10px 16px 12px; overflow-x: hidden; overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.claude-items > li { flex: none; min-width: 0; }
.claude-items p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cl-text { flex: 1; min-width: 0; }
.cl-text p.blank { height: .75em; }
.cl-text code { color: var(--cli-blue); font: inherit; }
.cl-text strong, .cl-heading { font-weight: 700; }
.cl-marker { color: var(--cli-dim); }
/* code and tables: the only places that scroll sideways */
.cl-code, .cl-table { max-width: 100%; margin: 2px 0; overflow-x: auto; font: inherit; white-space: pre; -webkit-overflow-scrolling: touch; }
.cl-code { color: var(--cli-blue); }
.cl-probe { position: absolute; visibility: hidden; white-space: pre; }
.claude-items .cl-you { display: flex; gap: 8px; margin: 0 -16px; padding: 2px 16px; background: var(--cli-bar); }
.cl-prompt { flex: none; color: var(--cli-dim); }
.claude-items .cl-claude { display: flex; gap: 8px; }
.cl-dot { flex: none; width: 1ch; }
.cl-tool .cl-call { overflow-wrap: anywhere; }
.cl-tool .cl-dot { display: inline-block; margin-right: 8px; color: var(--cli-green); }
.cl-tool.error .cl-dot { color: var(--cli-red); }
.cl-out, .claude-items .cl-event { display: flex; gap: 8px; padding-left: 2ch; color: var(--cli-dim); }
.cl-out.error, .claude-items .cl-event.error { color: var(--cli-red); }
.cl-elbow { flex: none; }
/* Ran 3 shell commands: folded, grey; a tap unfolds the tools. ∴ Thinking and many workers: the same. */
.cl-fold { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; margin: 0; padding: 0 0 0 calc(1ch + 8px); border: 0; background: none; color: var(--cli-dim); font: inherit; text-align: left; }
.cl-summary.error .cl-fold { color: var(--cli-red); }
.cl-thinking .cl-fold, .cl-workers .cl-fold { padding-left: 0; }
.cl-mark { flex: none; width: 1ch; }
.cl-thought { margin: 4px 0 0 calc(1ch + 8px); color: var(--cli-dim); font-style: italic; }
.cl-inner { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.claude-items .cl-working { display: flex; gap: 8px; color: var(--cli-orange); }
.cl-spin { flex: none; width: 1ch; }
.cl-spin::before { content: "✻"; animation: cli-spin 1.2s steps(1, end) infinite; }
@keyframes cli-spin {
  0% { content: "·"; } 16% { content: "✢"; } 33% { content: "✳"; } 50% { content: "✶"; } 66% { content: "✻"; } 83% { content: "✽"; }
}
.claude-items .cl-waiting { color: var(--cli-orange); }
.claude-items .cl-note { color: var(--cli-dim); }
.claude-items .cl-worker { display: flex; gap: 8px; padding-left: 2ch; color: var(--cli-dim); }
.cl-worker.running .cl-dot { color: var(--cli-orange); }
.cl-worker.done .cl-dot { color: var(--cli-green); }
.cl-worker.failed .cl-dot, .cl-worker.stopped .cl-dot { color: var(--cli-red); }
.cl-worker .cl-wbody { min-width: 0; }
.cl-worker p { margin: 0; }
.cl-worker .cl-act { opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-worker.cl-more { padding-left: calc(2ch + 8px + 1ch); }
.cl-said { flex: 1; min-width: 0; }
.cl-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cl-pick { min-height: 40px; padding: 4px 16px; border: 1px solid var(--cli-line); border-radius: 6px; background: var(--cli-panel); color: var(--cli-fg); font: inherit; }
.cl-pick:active { background: var(--cli-hover); }
/* the /model picker: models with a ✔ on the current one, the chosen row marked ❯, then the effort levels */
.claude-items .cl-picker { padding: 8px 0; border-top: 1px solid var(--cli-line); border-bottom: 1px solid var(--cli-line); }
.cl-picker-title { margin: 0 0 4px; color: var(--cli-orange); font-weight: 700; }
.cl-models { margin: 0; padding: 0; list-style: none; }
.cl-model { display: grid; grid-template-columns: 2ch auto auto 1fr; gap: 0 8px; width: 100%; min-height: 40px; padding: 4px 0; border: 0; background: none; color: var(--cli-dim); font: inherit; text-align: left; }
.cl-model.on { color: var(--cli-blue); }
.cl-tick { color: var(--cli-green); }
.cl-desc { grid-column: 2 / -1; padding-left: 3ch; color: var(--cli-dim); }
.cl-efforts { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; margin-top: 6px; color: var(--cli-dim); }
.cl-efforts.on .cl-effort-title { color: var(--cli-blue); }
.cl-effort-title { margin-right: 8px; }
.cl-effort { min-height: 40px; padding: 0 8px; border: 0; background: none; color: var(--cli-dim); font: inherit; }
.cl-effort.on { color: var(--cli-blue); font-weight: 700; text-decoration: underline; }
.cl-picker-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
/* the status line: Opus 5.5 · 1.2M in · 34k out */
.cl-line { flex: none; margin: 0; padding: 4px 16px; overflow: hidden; border-top: 1px solid var(--cli-line); color: var(--cli-dim); text-overflow: ellipsis; white-space: nowrap; }
/* typing "/": the commands it could be */
.cl-suggest { flex: none; margin: 0 16px 6px; padding: 4px 0; border: 1px solid var(--cli-line); border-radius: 6px; background: var(--cli-panel); list-style: none; }
.cl-suggestion { display: block; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; background: none; color: var(--cli-dim); font: inherit; text-align: left; }
.cl-suggestion strong { color: var(--cli-fg); font-weight: 400; }
.cl-suggestion:active { background: var(--cli-hover); }
/* the box: ❯ between two lines, as the terminal's prompt; 16px so iOS does not zoom in */
.cli .box { align-items: center; margin: 0; padding: 2px 8px 2px 16px; border-top: 1px solid var(--cli-line); border-bottom: 1px solid var(--cli-line); border-radius: 0; background: transparent; box-shadow: none; }
.cli .box::before { content: "❯"; flex: none; color: var(--cli-fg); }
.cli .box textarea { color: var(--cli-fg); font: 16px/1.4 var(--mono); }
.cli .box textarea::placeholder { color: var(--cli-dim); }
.cli .send { background: var(--cli-fg); color: var(--cli-bg); }
/* full screen (a session opens so): the head and the tabs make room, and the box keeps clear of the home bar */
.app.full { background: var(--cli-bg); }
.app.full .stage, .app.full .tabs { display: none; }
.app.full .claude-session { padding-bottom: var(--bottom); }
/* the Claude tab is open: the head and the tabs wear the same black, so the whole screen is the terminal */
.app.cli-tab { background: var(--cli-bg); }
.app.cli-tab .tabs { border-top-color: var(--cli-line); background: var(--cli-bg); }
.app.cli-tab .tabs button { color: var(--cli-dim); }
.app.cli-tab .tabs button[aria-pressed="true"] { color: var(--cli-fg); }
/* the keyboard is up: the tabs make room, and the box sits on the keys */
.app.keys .tabs { display: none; }
.app.keys .claude-session { padding-bottom: 0; }

/* settings */
.settings { gap: 10px; padding: 0 14px 16px; overflow-y: auto; }
.buddies { display: flex; gap: 12px; }
.buddies button { display: grid; flex: 1; justify-items: center; gap: 2px; padding: 10px; border: 2px solid var(--line); border-radius: 18px; background: var(--paper); font-weight: 600; }
.buddies button[aria-pressed="true"] { border-color: var(--ink); }
.buddies img { width: 88px; height: 88px; object-fit: contain; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.switch input { flex: none; width: 24px; height: 24px; accent-color: var(--ink); }
.facts { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.facts li { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.facts li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row { display: flex; align-items: center; gap: 8px; }
.field { flex: 1; min-width: 0; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 17px; }
.settings > .btn, .part > .btn { align-self: flex-start; }
.settings .error { margin: 0; }
/* a part of Settings that shows or hides as one (the AI form, Admin) */
.part { display: flex; flex-direction: column; gap: 10px; }
.label { margin: 4px 0 -4px; color: var(--ink-2); font-size: 15px; font-weight: 600; }
select.field { appearance: none; padding-right: 32px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236B5848' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center; }
p.row { margin: 0; }
.note { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--orange-tint); font-size: 15px; }
/* the admin's part */
.settings h3 { margin: 8px 0 0; font: 700 18px/1.1 var(--display); }
.switch small { display: block; color: var(--ink-2); font-size: 14px; }
.switch .num { flex: none; width: 96px; height: auto; text-align: right; }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 8px 10px; border-radius: 999px; font-size: 15px; font-weight: 600; text-align: center; }
.segmented input:checked + span { background: var(--ink); color: var(--cream); }
.segmented input:focus-visible + span { outline: 2px solid var(--orange); }
.users { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.users li { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.users li.blocked { background: var(--bad-bg); }
.users .who { flex: 1; min-width: 0; }
.users .name { display: block; font-weight: 600; }
.users .under { display: block; overflow: hidden; color: var(--ink-2); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.row .grow { flex: 1; min-width: 0; }
.good { margin: 0; color: var(--ok-ink); font-size: 15px; }

/* the tabs */
.tabs { display: flex; flex: none; padding-bottom: var(--bottom); border-top: 1px solid var(--line); background: var(--cream); }
.tabs button { flex: 1; min-height: 52px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600; }
.tabs button[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 3px 0 var(--orange); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
