/* Calls with bots (phone-calls.js): the Calls list in the app's own quiet
   style, and a full-screen call screen laid out like the phone's own
   in-call screen (name and timer on top, big round buttons, red end). */

/* ─── Calls list ─── */
.calls-status { color: var(--muted); font-size: 14px; margin: 4px 2px 6px !important; }
.calls-status.err { color: var(--danger); }
.calls-label { font-size: 12px; color: var(--faint); margin: 18px 2px 6px; }
.calls-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.bot-row, .call-row > summary { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 60px; }
.bot-row + .bot-row, .call-row + .call-row { border-top: 1px solid var(--border); }
.bot-av { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
.call-row .bot-av { width: 36px; height: 36px; }
.av-fallback { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600; flex: none; }
.bot-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bot-main strong { font-weight: 500; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-main small { color: var(--faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; }
.call-btn:active { opacity: .8; }
.call-btn.small { width: 32px; height: 32px; background: transparent; color: var(--accent); border: 1px solid var(--border); }
.call-btn.small svg { width: 16px; height: 16px; }
.add-btn { flex: none; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; }
.add-btn:disabled { opacity: .6; }
.call-row > summary { list-style: none; cursor: pointer; min-height: 56px; }
.call-row > summary::-webkit-details-marker { display: none; }
.call-row.missed .bot-main strong { color: var(--danger); }
.call-when { flex: none; color: var(--faint); font-size: 13px; }
.call-transcript { padding: 0 14px 12px 60px; display: flex; flex-direction: column; gap: 6px; }
.call-transcript p { margin: 0 !important; font-size: 14px !important; line-height: 1.45 !important; color: var(--text) !important; overflow-wrap: anywhere; }
.call-transcript p b { display: block; font-size: 11.5px; font-weight: 600; color: var(--faint); margin-bottom: 1px; }
.call-transcript p.none { color: var(--faint) !important; }
.calls-none { color: var(--faint) !important; font-size: 14px !important; margin: 0 2px !important; }
.calls-empty { padding: 18px 2px 0; }
.calls-empty h2 { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
.calls-foot { color: var(--faint) !important; font-size: 12.5px !important; margin: 18px 2px 0 !important; }

/* ─── Call screen ─── */
.call { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; overflow: hidden; color: #fff; background: var(--tint-bg, #1c2433);
  padding: calc(env(safe-area-inset-top) + 56px) 24px calc(env(safe-area-inset-bottom) + 30px); animation: call-in .28s ease;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Roboto, "Segoe UI", system-ui, sans-serif; }
@keyframes call-in { from { opacity: 0; transform: scale(1.04); } }
.call-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.call-bg-blob { position: absolute; left: 50%; top: 42%; width: 320px; height: 320px; transform: translate(-50%, -50%) scale(2.2); filter: blur(64px) saturate(1.3); opacity: .75; }
.call-bg-blob svg, .call-bg-blob .av-fallback { width: 100%; height: 100%; }
.call-bg::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .34); }
.call > :not(.call-bg) { position: relative; z-index: 1; }

.call-head { flex: none; text-align: center; }
.call-name { font-size: 34px; font-weight: 400; letter-spacing: .01em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-status { margin-top: 6px; font-size: 17px; color: rgba(255, 255, 255, .72); font-variant-numeric: tabular-nums; }

.call-mid { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12px 0; }
.call-face { display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 0; width: 100%; }
.call-orb { position: relative; display: flex; align-items: center; justify-content: center; }
.call-orb svg, .call-orb .av-fallback { width: min(168px, 24vh); height: min(168px, 24vh); }
.call-orb::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); opacity: 0; pointer-events: none; }
.call[data-phase="ringing"] .call-orb::before { animation: call-pulse 1.6s ease-out infinite; }
.call[data-phase="speaking"] .call-orb::before { animation: call-pulse 1.2s ease-out infinite; border-color: rgba(255, 255, 255, .35); }
@keyframes call-pulse { 0% { opacity: .8; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.18); } }
.call-state { min-height: 18px; font-size: 13px; color: rgba(255, 255, 255, .62); letter-spacing: .02em; }
.call-caption { max-width: 320px; min-height: 44px; text-align: center; font-size: 16px; line-height: 1.4; color: rgba(255, 255, 255, .92);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.call-caption.you { color: rgba(255, 255, 255, .7); font-style: italic; }
.call-note { margin: 0; max-width: 320px; text-align: center; font-size: 13px; line-height: 1.4; color: rgba(255, 255, 255, .7); }
.call-note:empty { display: none; }

.call-log { display: none; width: 100%; max-width: 420px; flex: 1; min-height: 0; border-radius: 18px; background: rgba(0, 0, 0, .28); padding: 4px; }
.call-log-list { height: 100%; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.call-log-list p { margin: 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.call-log-list p b { display: block; font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .55); margin-bottom: 1px; }
.call.show-log .call-face { display: none; }
.call.show-log .call-log { display: block; }

.call-type { display: none; width: 100%; max-width: 420px; gap: 8px; }
.call.typing .call-type, .call.show-log .call-type { display: flex; }
.call-type input { flex: 1; min-width: 0; height: 44px; border-radius: 22px; border: 0; outline: none; padding: 0 16px; font-size: 16px; color: #fff; background: rgba(255, 255, 255, .16); }
.call-type input::placeholder { color: rgba(255, 255, 255, .55); }
.call-type button { flex: none; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #111; display: inline-flex; align-items: center; justify-content: center; }

.call-grid { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; max-width: 300px; margin: 6px auto 30px; }
.cb-wrap { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.cb-wrap span { font-size: 13px; color: rgba(255, 255, 255, .85); }
.cb { width: 76px; height: 76px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); transition: background .15s, color .15s; }
.cb.on { background: rgba(255, 255, 255, .92); color: #1c1c1e; }
.cb:active { transform: scale(.96); }
.call-end { flex: none; width: 76px; height: 76px; border-radius: 50%; margin: 0 auto; background: #ff3b30; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.call-end:active { background: #d9322a; }
.call button:disabled { opacity: .55; }
.call[data-phase="ended"] .call-orb { opacity: .7; }

@media (max-height: 700px) {
  .call { padding-top: calc(env(safe-area-inset-top) + 28px); padding-bottom: calc(env(safe-area-inset-bottom) + 18px); }
  .call-name { font-size: 30px; }
  .cb, .call-end { width: 66px; height: 66px; }
  .call-grid { margin-bottom: 18px; }
}

/* Approvals during a call (the bot wants to send an email, edit a file...) */
.call-approve { position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 200px); z-index: 6; background: rgba(28, 28, 30, 0.96); color: #fff; border-radius: 18px; padding: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); }
.call-approve.danger { box-shadow: 0 0 0 1px rgba(255, 82, 87, 0.6), 0 12px 40px rgba(0, 0, 0, 0.45); }
.call-approve-title { font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.call-approve pre { margin: 0 0 12px; max-height: 120px; overflow: auto; font: 12.5px/1.45 ui-monospace, Menlo, monospace; color: rgba(255, 255, 255, 0.7); white-space: pre-wrap; background: rgba(255, 255, 255, 0.07); border-radius: 10px; padding: 8px 10px; }
.call-approve-row { display: flex; gap: 10px; }
.call-approve-row button { flex: 1; height: 44px; border-radius: 12px; border: 0; font: inherit; font-weight: 600; background: rgba(255, 255, 255, 0.14); color: #fff; }
.call-approve-row button.primary { background: var(--accent, #4b9dff); color: var(--accent-text, #fff); }
.call-email { bottom: calc(env(safe-area-inset-bottom, 0px) + 120px); max-height: calc(100% - 160px); overflow: auto; }
.call-email-field { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.12); font-size: 15px; }
.call-email-field span { width: 62px; flex-shrink: 0; color: rgba(255, 255, 255, 0.55); }
.call-email-field input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: #fff; font: inherit; font-size: 16px; padding: 2px 0; }
.call-email textarea { display: block; width: 100%; box-sizing: border-box; margin: 10px 0 12px; min-height: 110px; resize: none; background: rgba(255, 255, 255, 0.07); border: 0; border-radius: 10px; padding: 10px; color: #fff; font: inherit; font-size: 16px; line-height: 1.45; outline: none; }
.call-email .call-approve-row button { font-size: 14px; }

/* Build a bot from a prompt */
.new-bot-btn { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; width: 100%; padding: 12px 14px; margin: 4px 0 14px; border-radius: 14px; border: 1px dashed var(--border); text-align: left; color: var(--text); background: transparent; }
.new-bot-btn svg { grid-row: span 2; width: 22px; height: 22px; color: var(--accent); }
.new-bot-btn span { font-weight: 600; font-size: 15px; }
.new-bot-btn small { color: var(--faint); font-size: 12.5px; }
.new-bot-btn:active { background: var(--surface); }
.nb-ideas { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 6px; }
.nb-idea { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: 13px; background: transparent; text-align: left; }
.nb-err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 2px 10px; }
.nb-stage { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 6px 0 14px; }
.nb-surprise { font-size: 13px; color: var(--accent); background: transparent; padding: 4px 8px; }
.nb-voice { display: flex; gap: 8px; }
.nb-voice select { flex: 1; min-width: 0; }
.nb-voice .nb-preview { height: auto; padding: 0 14px; flex: none; }
.nb-toast { position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); z-index: 70; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 14px; background: var(--sheet, #1c1c1e); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: rise .2s ease; }
.nb-toast span { flex: 1; font-weight: 500; }
.nb-toast button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; background: var(--accent); color: var(--accent-text, #fff); font-weight: 600; }
.nb-toast button svg { width: 16px; height: 16px; }
.nb-sheet { z-index: 80; }
.nb-sheet .field textarea { font-family: inherit; font-size: 15px; min-height: 84px; }

/* Thinking: a slow breath on the avatar and a soft glow, nothing loud. */
.call[data-phase="thinking"] .call-orb { animation: call-breathe 2.4s ease-in-out infinite; }
.call[data-phase="thinking"] .call-orb::after { content: ""; position: absolute; inset: -22px; border-radius: 50%; pointer-events: none; background: radial-gradient(closest-side, rgba(255, 255, 255, .16), transparent 70%); animation: call-glow 2.4s ease-in-out infinite; }
.call[data-phase="thinking"] .call-state { background: linear-gradient(90deg, rgba(255,255,255,.45) 0%, #fff 50%, rgba(255,255,255,.45) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: call-shimmer 1.8s linear infinite; }
@keyframes call-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes call-glow { 0%, 100% { opacity: .25; } 50% { opacity: .8; } }
@keyframes call-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .call[data-phase="thinking"] .call-orb, .call[data-phase="thinking"] .call-orb::after, .call[data-phase="thinking"] .call-state { animation: none; } }

/* ─── Reminders (phone-reminders.js) ─── */
.rem-card { margin: 6px 0 14px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; }
.rem-card-main { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.rem-card-main strong { font-weight: 600; font-size: 15.5px; }
.rem-card-main small { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.rem-card-row { display: flex; gap: 10px; }
.rem-card-row .btn { flex: 1; height: 40px; font-size: 14.5px; }
.rem-hint { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0 14px; padding: 10px 8px 10px 14px; border: 1px solid var(--border); border-radius: 14px; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.rem-hint span { flex: 1; }
.rem-x { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--faint); background: transparent; }
.rem-x:active { background: var(--surface); }
.rem-x:disabled { opacity: .4; }
.rem-row { min-height: 56px; }
.rem-row .bot-main strong { font-size: 15px; }
.bot-av.rem-av { width: 36px; height: 36px; }

/* A bot calling you: Decline and Answer, like the phone's own incoming call. */
.call-answer-row { flex: none; display: flex; justify-content: space-around; width: 100%; max-width: 320px; margin: 0 auto 30px; }
.call-answer-row .cb-wrap span { margin-top: 2px; }
.call-accept { flex: none; width: 76px; height: 76px; border-radius: 50%; background: #34c759; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.call-accept svg { width: 34px; height: 34px; }
.call-accept:active { background: #2db14f; }
.call.incoming .call-orb { animation: call-breathe 1.6s ease-in-out infinite; }
.call.incoming .call-caption { color: rgba(255, 255, 255, .8); }
@media (max-height: 700px) { .call-accept { width: 66px; height: 66px; } }
@media (prefers-reduced-motion: reduce) { .call.incoming .call-orb { animation: none; } }

/* Reminders that already went out today: listed under Earlier, quieter. */
.rem-past { opacity: .62; }
.rem-past strong { font-weight: 500; }

/* Bots at work (phone-life.js): what the bots are doing on their own. */
.life-card { margin: 6px 0 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; }
.life-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.life-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.life-btn { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: none; color: inherit; font: inherit; font-size: 13px; flex: none; }
.life-btn.danger { color: var(--danger); }
.life-btn[disabled] { opacity: .5; }

/* Bots at work, run from the phone while the PC is off (phone-bots.js) */
.bw-row { flex-wrap: wrap; align-items: flex-start; }
.bw-row .bot-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 100%; }
.bw-row small.err { color: var(--red); }
.bw-draft { width: 100%; box-sizing: border-box; margin-top: 6px; font: inherit; font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 9px 11px; resize: vertical; }
.bw-acts { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.bw-acts .life-btn { display: inline-flex; align-items: center; }
.bw-acts a.life-btn { text-decoration: none; }

/* The Reminders screen (phone-reminders.js openPanel): add one at the top, the list below */
.rem-add { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 16px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; }
.rem-add input { height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); padding: 0 13px; color: var(--text); font-size: 16px; outline: none; min-width: 0; }
.rem-add input:focus { border-color: var(--muted); }
.rem-add-row { display: flex; gap: 8px; }
.rem-add-row input { flex: 1; }
.rem-add-row .btn { flex: none; width: auto; min-width: 76px; height: 44px; padding: 0 16px; }
.rem-add-err { margin: 0; color: var(--red, #e5484d); font-size: 13.5px; }
@media (hover: hover) { .rem-x:hover { background: var(--surface); color: var(--text); } }
