/* LAUNCH_FIX11: physical-edge fixed controls, live layout diagnostics and R12 calls. */

#blueink-r11 {
  --bottom-nav-height:64px;
  --composer-height:54px;
}

/* Fixed controls use the physical iOS standalone containing block. Bleed is
   deliberately absent from these offsets; safe area is counted exactly once. */
#blueink-r11 .bottom-nav {
  position:fixed!important;
  right:auto!important;
  bottom:calc(env(safe-area-inset-bottom,0px) + 8px)!important;
  left:50%!important;
  width:min(calc(100vw - 28px),432px);
  margin:0!important;
  transform:translateX(-50%);
}

#blueink-r11 .composer,
#blueink-r11 .r12-composer {
  position:fixed!important;
  right:auto!important;
  bottom:calc(env(safe-area-inset-bottom,0px) + 6px)!important;
  left:50%!important;
  width:min(calc(100vw - 24px),436px);
  margin:0!important;
  transform:translateX(-50%);
}

html[data-keyboard-open="true"] #blueink-r11 .composer,
html[data-keyboard-open="true"] #blueink-r11 .r12-composer {
  bottom:calc(var(--kb-inset,0px) + 6px)!important;
}

/* ResizeObserver writes the two height variables. Root pages and chat reserve
   the measured control, its fixed offset, safe area and a small fade runway. */
#blueink-r11 .screen[data-root-page] > [data-scroll] {
  --scroll-fade-bottom:calc(var(--bottom-nav-height,64px) + env(safe-area-inset-bottom,0px) + 24px);
  padding-bottom:calc(var(--bottom-nav-height,64px) + env(safe-area-inset-bottom,0px) + 32px)!important;
}

#blueink-r11 [data-scroll="conversation"] {
  --scroll-fade-bottom:calc(var(--composer-height,54px) + env(safe-area-inset-bottom,0px) + 20px);
  padding-bottom:calc(var(--composer-height,54px) + env(safe-area-inset-bottom,0px) + 34px)!important;
}

html[data-keyboard-open="true"] #blueink-r11 [data-scroll="conversation"] {
  --scroll-fade-bottom:calc(var(--composer-height,54px) + 18px);
  padding-bottom:calc(var(--composer-height,54px) + 30px)!important;
}

/* Safe-area measurement probe. Its computed paddings are copied into the
   diagnostic report; it never participates in layout or hit testing. */
.layout-safe-area-probe {
  position:fixed;
  z-index:-1;
  top:0;
  left:0;
  width:0;
  height:0;
  padding-top:env(safe-area-inset-top,0px);
  padding-right:env(safe-area-inset-right,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);
  padding-left:env(safe-area-inset-left,0px);
  visibility:hidden;
  pointer-events:none;
}

#blueink-r11 .layout-diagnostics {
  position:fixed;
  z-index:500;
  top:calc(env(safe-area-inset-top,0px) + 10px);
  right:10px;
  bottom:calc(env(safe-area-inset-bottom,0px) + 10px);
  left:10px;
  display:flex;
  flex-direction:column;
  width:min(calc(100vw - 20px),440px);
  margin:0 auto;
  padding:16px;
  border:1px solid color-mix(in srgb,var(--gold) 60%,var(--hair));
  border-radius:22px;
  color:var(--ink);
  background:color-mix(in srgb,var(--glass-strong) 96%,transparent);
  box-shadow:0 20px 70px rgba(20,28,48,.28);
  backdrop-filter:blur(22px) saturate(1.08);
  -webkit-backdrop-filter:blur(22px) saturate(1.08);
}

#blueink-r11 .layout-diagnostics header,
#blueink-r11 .layout-diagnostics footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

#blueink-r11 .layout-diagnostics header div { display:grid;gap:3px; }
#blueink-r11 .layout-diagnostics header strong { font:600 17px/1.3 var(--font-title); }
#blueink-r11 .layout-diagnostics header small { color:var(--secondary);font:11px/1.4 var(--font-ui); }
#blueink-r11 .layout-diagnostics pre {
  flex:1;
  min-height:0;
  margin:14px 0;
  padding:13px;
  overflow:auto;
  border:1px solid var(--hair);
  border-radius:15px;
  color:var(--ink);
  background:color-mix(in srgb,var(--paper) 84%,transparent);
  font:11px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
#blueink-r11 .layout-diagnostics button {
  min-height:42px;
  padding:0 15px;
  border:1px solid color-mix(in srgb,var(--gold) 46%,var(--hair));
  border-radius:999px;
  color:var(--ribbon-deep);
  background:var(--glass-ui);
}
#blueink-r11 .layout-diagnostics footer { justify-content:flex-end; }
#blueink-r11 .b6-layout-diagnostic-entry { display:flex;align-items:center;justify-content:space-between;gap:14px; }
#blueink-r11 .b6-layout-diagnostic-entry h2,
#blueink-r11 .b6-layout-diagnostic-entry p { margin:0; }
#blueink-r11 .b6-layout-diagnostic-entry p { margin-top:5px;color:var(--secondary);font:11px/1.55 var(--font-ui); }

/* R12 call surfaces. The legacy engine keeps state and audio ownership; this
   layer owns all visible materials and icons. */
#blueink-r11 .daily-call-host {
  --dc-ink:var(--ink);
  --dc-muted:var(--secondary);
  --dc-paper:var(--paper);
  --dc-line:color-mix(in srgb,var(--gold) 34%,var(--hair));
}

#blueink-r11 .daily-call-host .daily-call-overlay,
#blueink-r11 .daily-call-host .incall,
#blueink-r11 .daily-call-host .daily-call-history {
  z-index:240;
}

#blueink-r11 .daily-call-host .daily-call-backdrop,
#blueink-r11 .daily-call-host .incall-bg {
  background:linear-gradient(rgba(247,241,230,.78),rgba(247,241,230,.90));
  backdrop-filter:blur(16px) saturate(.94);
  -webkit-backdrop-filter:blur(16px) saturate(.94);
}

#blueink-r11[data-theme="night"] .daily-call-host .daily-call-backdrop,
#blueink-r11[data-theme="night"] .daily-call-host .incall-bg {
  background:linear-gradient(rgba(20,26,42,.90),rgba(20,26,42,.97));
}

#blueink-r11 .daily-call-host .daily-call-stage,
#blueink-r11 .daily-call-host .incall-card {
  position:relative;
  width:min(100%,520px);
  height:100%;
  min-height:100dvh;
  padding:calc(env(safe-area-inset-top,0px) + 62px) 24px calc(env(safe-area-inset-bottom,0px) + 24px);
  overflow:hidden;
  border:0;
  border-radius:0;
  color:var(--dc-ink);
  background:radial-gradient(circle at 50% 30%,color-mix(in srgb,var(--ribbon) 18%,transparent),transparent 36%),transparent;
  box-shadow:none;
}

#blueink-r11 .daily-call-host .call-kicker {
  position:absolute;
  top:calc(env(safe-area-inset-top,0px) + 24px);
  left:50%;
  color:var(--gold);
  font:10px/1 var(--font-number);
  letter-spacing:.24em;
  transform:translateX(-50%);
}

#blueink-r11 .daily-call-host .call-avatar-wrap,
#blueink-r11 .daily-call-host .incall-avwrap {
  position:relative;
  display:grid;
  width:146px;
  height:146px;
  margin:34px auto 0;
  place-items:center;
  overflow:visible;
  opacity:1;
}

#blueink-r11 .daily-call-host .call-avatar,
#blueink-r11 .daily-call-host .incall-av {
  position:relative;
  z-index:2;
  display:grid;
  width:116px;
  height:116px;
  overflow:hidden;
  border:2px solid var(--gold);
  border-radius:50%;
  color:var(--ribbon-deep);
  background:var(--glass-strong);
  box-shadow:0 0 0 7px color-mix(in srgb,var(--gold) 14%,transparent),0 15px 36px rgba(43,52,76,.16);
  place-items:center;
  font:600 30px/1 var(--font-title);
}

#blueink-r11 .daily-call-host .call-avatar img,
#blueink-r11 .daily-call-host .incall-av img { width:100%;height:100%;object-fit:cover; }
#blueink-r11 .daily-call-host .call-avatar img[src],
#blueink-r11 .daily-call-host .incall-av img[src] { display:block; }

#blueink-r11 .daily-call-host .call-wave-ring,
#blueink-r11 .daily-call-host .incall-ripple {
  position:absolute;
  inset:3px;
  border:1px solid color-mix(in srgb,var(--gold) 70%,transparent);
  border-radius:50%;
}
#blueink-r11 .daily-call-host .call-wave-ring.call-wave-active,
#blueink-r11 .daily-call-host #call-overlay[data-state="connecting"] .call-wave-ring,
#blueink-r11 .daily-call-host .incall.incall-show .incall-ripple { animation:r12-call-ring 1.8s ease-out infinite; }
#blueink-r11 .daily-call-host .incall-ripple.r2 { inset:-7px;animation-delay:.45s;opacity:.56; }
#blueink-r11 .daily-call-host .incall-ripple.r3 { inset:-17px;animation-delay:.9s;opacity:.28; }
@keyframes r12-call-ring { 70%,100% { transform:scale(1.1);opacity:0; } }

#blueink-r11 .daily-call-host .call-name,
#blueink-r11 .daily-call-host .incall-name { margin-top:20px;font:600 22px/1.35 var(--font-title);letter-spacing:.08em; }
#blueink-r11 .daily-call-host .call-timer,
#blueink-r11 .daily-call-host .incall-timer { margin-top:6px;color:var(--gold);font:14px/1.3 var(--font-number);letter-spacing:.09em; }
#blueink-r11 .daily-call-host .call-status { min-height:20px;margin-top:8px;color:var(--ribbon-deep);font:12px/1.5 var(--font-ui);letter-spacing:.12em; }
#blueink-r11 .daily-call-host #call-overlay[data-state="connecting"] .call-status { color:var(--gold); }
#blueink-r11 .daily-call-host #call-overlay[data-state="listening"] .call-status { color:var(--ribbon-deep); }
#blueink-r11 .daily-call-host #call-overlay[data-state="processing"] .call-status { color:var(--gold); }
#blueink-r11 .daily-call-host #call-overlay[data-state="speaking"] .call-status { color:var(--ribbon-deep); }
#blueink-r11 .daily-call-host #call-overlay[data-state="ended"] .call-status { color:var(--gold); }

#blueink-r11 .daily-call-host .call-subtitle-wrap {
  position:relative;
  display:block;
  width:min(100%,390px);
  min-height:112px;
  margin-top:24px;
  padding:25px 18px 16px;
  border:1px solid var(--dc-line);
  border-radius:18px;
  background:linear-gradient(172deg,rgba(255,253,249,.78),rgba(247,241,230,.60));
  box-shadow:0 9px 28px rgba(49,55,72,.08),inset 0 1px 0 rgba(255,255,255,.55);
}
#blueink-r11[data-theme="night"] .daily-call-host .call-subtitle-wrap { background:linear-gradient(172deg,rgba(35,42,66,.92),rgba(20,26,42,.78)); }
#blueink-r11 .daily-call-host .call-subtitle-label { position:absolute;top:9px;left:17px;color:var(--gold);font:9px/1 var(--font-ui);letter-spacing:.18em; }
#blueink-r11 .daily-call-host .call-subtitle { max-height:92px;overflow:auto;color:var(--dc-ink);font:13px/1.72 var(--font-body);text-align:left; }
#blueink-r11 .daily-call-host .call-sub-user { color:var(--ribbon-deep); }
#blueink-r11 .daily-call-host .call-sub-ai { color:var(--dc-ink); }

#blueink-r11 .daily-call-host .call-actions { display:flex;gap:18px;margin-top:auto;padding-top:24px; }
#blueink-r11 .daily-call-host .call-actions button { width:68px;height:auto;border:0;border-radius:0;background:none;box-shadow:none; }
#blueink-r11 .daily-call-host .call-actions button i,
#blueink-r11 .daily-call-host .incall-ico {
  display:grid;
  width:56px;
  height:56px;
  margin:0 auto;
  border:1px solid color-mix(in srgb,var(--gold) 48%,var(--hair));
  border-radius:50%;
  color:var(--ribbon-deep);
  background:color-mix(in srgb,var(--glass-ui) 82%,transparent);
  box-shadow:0 6px 20px rgba(44,53,75,.09),inset 0 1px 0 rgba(255,255,255,.48);
  place-items:center;
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}
#blueink-r11 .daily-call-host .call-actions button span,
#blueink-r11 .daily-call-host .incall-btn > span:last-child { display:block;margin-top:8px;color:var(--dc-muted);font:11px/1.3 var(--font-ui); }
#blueink-r11 .daily-call-host .call-line-icon { width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round; }

#blueink-r11 .daily-call-host .call-hangup {
  display:grid;
  width:62px;
  height:62px;
  margin:18px auto 7px;
  border:1px solid rgba(255,255,255,.22);
  border-radius:50%;
  color:#fff;
  background:#a95662;
  box-shadow:0 10px 28px rgba(145,58,70,.25);
  place-items:center;
}
#blueink-r11 .daily-call-host .call-hangup i { display:grid;place-items:center; }
#blueink-r11 .daily-call-host .call-hangup svg { width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.8; }
#blueink-r11 .daily-call-host .call-hangup span { position:absolute;margin-top:96px;color:var(--dc-muted);font:11px/1.3 var(--font-ui);transform:none; }
#blueink-r11 .daily-call-host .call-paper-art,
#blueink-r11 .daily-call-host .incall-paper-art { position:absolute;z-index:-1;right:-12px;bottom:8px;width:132px;opacity:.14;pointer-events:none; }

#blueink-r11 .daily-call-host .call-caption-toggle,
#blueink-r11 .daily-call-host .call-minimize-btn {
  top:calc(env(safe-area-inset-top,0px) + 15px);
  min-height:38px;
  padding:0 12px;
  border:1px solid var(--dc-line);
  border-radius:999px;
  color:var(--dc-muted);
  background:color-mix(in srgb,var(--glass-ui) 82%,transparent);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
#blueink-r11 .daily-call-host .call-minimize-btn svg { fill:none;stroke:currentColor;stroke-width:1.65; }

#blueink-r11 .daily-call-host .incall-card { justify-content:center;padding-top:calc(env(safe-area-inset-top,0px) + 36px); }
#blueink-r11 .daily-call-host .incall-kind { color:var(--gold);font:10px/1 var(--font-ui);letter-spacing:.18em; }
#blueink-r11 .daily-call-host .incall-kind i { background:var(--ribbon-deep);box-shadow:0 0 0 4px color-mix(in srgb,var(--ribbon) 18%,transparent); }
#blueink-r11 .daily-call-host .incall-reason { max-width:310px;margin-top:12px;color:var(--dc-muted);font:13px/1.7 var(--font-body); }
#blueink-r11 .daily-call-host .incall-dock { display:flex;gap:64px;margin-top:34px; }
#blueink-r11 .daily-call-host .incall-btn { min-width:76px; }
#blueink-r11 .daily-call-host .incall-acc { color:#fff;background:var(--ribbon-deep); }
#blueink-r11 .daily-call-host .incall-dec { color:#a95662; }
#blueink-r11 .daily-call-host .incall-quick { width:min(100%,360px);margin-top:20px;padding:14px;border:1px solid var(--dc-line);border-radius:18px;background:color-mix(in srgb,var(--glass-ui) 84%,transparent);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px); }
#blueink-r11 .daily-call-host .incall-quick button,
#blueink-r11 .daily-call-host .incall-quick input { min-height:40px;border:1px solid var(--dc-line);color:var(--dc-ink);background:var(--glass-strong); }

#blueink-r11 .daily-call-host .call-ending .call-actions,
#blueink-r11 .daily-call-host .call-ending .call-hangup,
#blueink-r11 .daily-call-host .call-ending .call-caption-toggle { visibility:hidden; }
#blueink-r11 .daily-call-host .call-ending .call-avatar { filter:grayscale(.2); }

#blueink-r11 .daily-call-host .call-mini { border-color:var(--dc-line);border-radius:999px;background:var(--glass-strong);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px); }
#blueink-r11 .daily-call-host .call-mini-end svg { fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round; }

#blueink-r11 .daily-call-host .daily-call-history { z-index:240;background:var(--paper); }
#blueink-r11 .daily-call-host .daily-call-history > header { background:color-mix(in srgb,var(--paper) 88%,transparent);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px); }
#blueink-r11 .daily-call-host .daily-call-history header button { font-size:inherit; }
#blueink-r11 .daily-call-host .daily-call-history header button svg { width:22px;height:22px; }
#blueink-r11 .daily-call-host .call-history-avatar > i { border:1px solid var(--gold);color:var(--ribbon-deep);background:var(--glass-strong); }
#blueink-r11 .daily-call-host .call-history-avatar > i svg { width:11px;height:11px; }
#blueink-r11 .daily-call-host .call-history-back { display:inline-flex;align-items:center;gap:7px; }
#blueink-r11 .daily-call-host .call-history-back svg { width:17px;height:17px; }
#blueink-r11 .daily-call-host .call-audio { display:inline-flex;align-items:center;gap:7px;border:1px solid var(--dc-line);background:var(--glass-ui); }
#blueink-r11 .daily-call-host .call-audio svg { width:15px;height:15px; }
#blueink-r11 .daily-call-host .transcript-paper { background:linear-gradient(172deg,rgba(255,253,249,.70),rgba(247,241,230,.52)); }
#blueink-r11[data-theme="night"] .daily-call-host .transcript-paper { background:linear-gradient(172deg,rgba(35,42,66,.90),rgba(20,26,42,.72)); }

#blueink-r11 .daily-media-call-mark svg { width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round; }
#blueink-r11 .daily-media-call-transcript > svg { flex:0 0 18px;width:18px;height:18px;margin-top:2px;fill:none;stroke:var(--gold);stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round; }

@media (max-height:720px) {
  #blueink-r11 .daily-call-host .call-avatar-wrap { width:112px;height:112px;margin-top:18px; }
  #blueink-r11 .daily-call-host .call-avatar { width:88px;height:88px; }
  #blueink-r11 .daily-call-host .call-subtitle-wrap { min-height:82px;margin-top:14px; }
  #blueink-r11 .daily-call-host .call-actions { padding-top:14px; }
}

@media (prefers-reduced-motion:reduce) {
  #blueink-r11 .daily-call-host :is(.call-wave-ring,.incall-ripple) { animation:none!important; }
}
