:root {
  --bg: #000000;
  --card: #0b0b0b;
  --text: #f5f5f5;
  --muted: #a8a8a8;
  --line: #232323;
  --accent: #f5f5f5;
  --ringLight: rgba(255,255,255,0.95);
  --ringDark: rgba(0,0,0,0.92);
  --title: #999999;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Inter, sans-serif;
  padding-top: env(safe-area-inset-top, 0px);
}
.shell { position: relative; max-width: 980px; margin: 0 auto; padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px)); }

.pageTitle {
  margin: 0 0 20px;
  font-size: 18pt;
  font-weight: 600;
  text-align: center;
  color: var(--title);
}

.stickyTop {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  padding-bottom: 4px;
}
.callStatusBar {
  max-width: 520px;
  margin: 6px auto 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.045);
}
.callStatusDot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #777;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}
.callStatusText { min-width: 0; }
.callStatusLabel {
  font-size: 12px;
  font-weight: 700;
  color: #f5f5f5;
  line-height: 1.2;
}
.callStatusDetail {
  font-size: 11px;
  color: #999;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.callStatusAction {
  border: 1px solid #444;
  background: rgba(255,255,255,0.08);
  color: #ddd;
  padding: 5px 9px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
}
.callStatusBar[data-state="ready"] .callStatusDot { background: #9ca3af; }
.callStatusBar[data-state="connecting"] .callStatusDot,
.callStatusBar[data-state="thinking"] .callStatusDot,
.callStatusBar[data-state="reconnecting"] .callStatusDot { background: #f5c842; }
.callStatusBar[data-state="listening"] .callStatusDot,
.callStatusBar[data-state="you-speaking"] .callStatusDot { background: #4ade80; }
.callStatusBar[data-state="eve-speaking"] .callStatusDot { background: #64b5f6; }
.callStatusBar[data-state="error"] .callStatusDot { background: #f87171; }
.stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
  justify-items: center;
  min-height: auto;
  max-width: 520px;
  margin: 14px auto 0;
  padding: 10px 0 8px;
  flex-shrink: 0;
}
.callBadge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #c0392b;
  border: none;
  opacity: 0;
  transition: opacity 120ms ease, transform 140ms ease;
  pointer-events: none;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.stage.inCall .callBadge { pointer-events: auto; }
.callBadge:active { transform: translate(-50%, -50%) scale(1.1); }
.stage.inCall .callBadge { opacity: 1; z-index: 2; }
.callTimer {
  position: absolute;
  left: 50%;
  top: calc(50% + 38px);
  transform: translateX(-50%);
  font-size: 12px;
  color: #a8a8a8;
  font-variant-numeric: tabular-nums;
  z-index: 2;
}
.stage::before {
  content: '';
  position: absolute;
  left: var(--line-left, 50%);
  top: 50%;
  transform: translateY(-50%);
  width: var(--line-width, 0px);
  height: 2px;
  background: linear-gradient(to right, #404040, #aaa, #404040);
  border-radius: 2px;
  transition: opacity 0.3s ease;
  opacity: 0;
  z-index: 1;
}
.stage.inCall::before {
  opacity: 1;
}
.participantCol { display: grid; place-items: center; width: 100%; position: relative; z-index: 2; }
.nameTag {
  display: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 120ms ease, text-shadow 120ms ease;
}
.nameTag.speaking {
  color: #f5f5f5;
  text-shadow: 0 0 10px rgba(255,255,255,0.25);
}
.nameTag.speaking::after {
  content: '  • speaking';
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.72);
}

.avatar {
  --ring: 1px;
  --voice-ring: 0px;
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  background-image: url('avatar.jpg');
  background-size: cover;
  background-position: center;
  border: 1px solid #999;
  box-shadow:
    0 0 0 var(--ring) var(--ringLight),
    0 0 0 calc(var(--ring) * 2) color-mix(in srgb, var(--ringDark) 65%, transparent),
    0 12px 30px rgba(0,0,0,0.18);
  outline: var(--voice-ring) solid rgba(200, 200, 200, 0.7);
  outline-offset: 0px;
  transition: box-shadow 60ms linear, outline 60ms linear;
  will-change: box-shadow, outline, transform;
}
.dimmed {
  filter: brightness(0.35);
  transition: filter 0.3s;
}
.callBtn.dimmed {
  background: rgba(255, 255, 255, 0.08) !important;
  filter: none;
}
@keyframes ringGlow {
  0%, 100% { filter: brightness(0.5); }
  50% { filter: brightness(1.2); }
}
.avatar.ringing, .callBtn.ringing {
  animation: ringGlow 1s ease-in-out infinite;
}
.avatar.speaking, .callBtn.speaking {
  box-shadow:
    0 0 0 var(--ring) var(--ringLight),
    0 0 0 calc(var(--ring) * 2) color-mix(in srgb, var(--ringDark) 65%, transparent),
    0 0 20px rgba(255,255,255,0.18),
    0 12px 30px rgba(0,0,0,0.18);
}

@media (prefers-reduced-motion: reduce) {
  .avatar, .iconBtn, .nameTag {
    transition: none !important;
  }
  .avatar.ringing, .callBtn.ringing {
    animation: none !important;
  }
}

.iconBtn {
  --ring: 1px;
  --voice-ring: 0px;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  border: 1px solid #999;
  background: var(--accent);
  color: var(--bg);
  font-size: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow:
    0 0 0 var(--ring) var(--ringLight),
    0 0 0 calc(var(--ring) * 2) color-mix(in srgb, var(--ringDark) 65%, transparent),
    0 12px 30px rgba(0,0,0,0.14);
  outline: var(--voice-ring) solid rgba(255, 255, 255, 0.8);
  outline-offset: 0px;
  transition: box-shadow 60ms linear, outline 60ms linear, background 140ms ease, color 140ms ease, transform 140ms ease;
  will-change: box-shadow, outline, transform;
}
.iconBtn:active { transform: scale(1.06); }
.iconBtn.pressPulse, .logoutIconBtn.pressPulse, #transcriptToggle.pressPulse { animation: pressPulse 220ms ease; }
@keyframes pressPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.callBtn {
  background: rgba(32, 32, 36, 0.75);
  color: #ffffff;
}
.callBtn.profileFace {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
}
.iconBtn.active { background: rgba(32, 32, 36, 0.75); color: #ffffff; }
.iconBtn.active.profileFace { color: transparent; }
body.theme-dark .iconBtn.active { background: rgba(32, 32, 36, 0.75); color: #ffffff; }

.mediaCard, .card, .advanced {
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.cameraSection {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

.cameraIconBtn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #222;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 0;
}
.cameraIconBtn:hover { opacity: 0.8; }
.cameraIconBtn.active { opacity: 1; background: #333; }
.camSvg { width: 28px; height: 28px; }
.camSvg[hidden] { display: none !important; }

.cameraPreviewWrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
}
.cameraPreviewWrap[hidden] { display: none !important; }

.cameraPreview {
  position: relative;
  width: 160px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #444;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.cameraPreview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cameraPreview video.front { transform: scaleX(-1); }

.cameraFlipBtn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(60,60,60,0.7);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.cameraFlipBtn svg { width: 18px; height: 18px; }

.transcriptCard {
  overflow: hidden;
  padding: 10px 12px 0 !important;
  border: 1px solid #333;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
}
.transcriptExpandRow {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  cursor: ns-resize;
  padding: 3px 0;
  user-select: none;
  -webkit-user-select: none;
}
.expandHandle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #555;
  transition: background 0.2s;
}
.transcriptExpandRow:hover .expandHandle { background: #888; }
.transcriptExpandRow.hasNew .expandHandle { background: #4ade80; transition: background 0.3s; }
.transcriptExpandRow.hasNew:hover .expandHandle { background: #6ee7a0; }
/* Floating scroll-to-bottom pill */
.scrollPill {
  position: absolute;
  bottom: 60px; /* above chat bar */
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: rgba(60,60,60,0.9);
  border: 1px solid #555;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.scrollPill:not(.hidden) { opacity: 1; }
.scrollPill.hidden { pointer-events: none; opacity: 0; }
.scrollPill.hasNew { background: rgba(74,222,128,0.25); border-color: #4ade80; }
.scrollPill:active { background: rgba(80,80,80,0.95); }
.transcriptCard { position: relative; } /* for pill positioning */
.transcriptStream {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
  min-height: 60px;
  padding: 0 4px;
}
.tMsg {
  font-size: 13px;
  line-height: 1.5;
  color: #ccc;
  white-space: pre-wrap;
  word-break: break-word;
}
.tMsg.user { color: #b0b0b0; }
.tMsg.eve { color: #fff; }
.tMsgBody { line-height: 1.5; }
.tMsgBody p { margin: 0.1em 0; }
.tMsgBody p:empty { display: none; }
.tMsgBody p + ul, .tMsgBody p + ol { margin-top: 0; }
.tMsgBody ul + p, .tMsgBody ol + p { margin-top: 0.1em; }
.tMsgBody h1, .tMsgBody h2, .tMsgBody h3, .tMsgBody h4 { margin: 0.3em 0 0.1em; font-size: 1em; color: #fff; }
.tMsgBody ul, .tMsgBody ol { margin: 0.15em 0; padding-left: 1.2em; }
.tMsgBody li { margin: 0.1em 0; }
.tMsgBody a { color: #6cb4ff; }
.tMediaPreview {
  max-width: 180px;
  max-height: 120px;
  border-radius: 8px;
  margin-top: 4px;
  object-fit: cover;
}
.tFileRow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: #aaa;
}
.tFileRow svg { flex-shrink: 0; }
.tPdfIcon { display: flex; align-items: center; }
.tFileRow span { word-break: break-all; }
.tMsg .tRole {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.displayCard {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 10px;
  overflow: visible;
  margin: 4px 0;
}
.displayCard .dcHeader {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid #2a2a2a;
  font-size: 12px;
  font-weight: 600;
  color: #aaa;
}
.displayCard .dcBody {
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #e0e0e0;
}
.dcBody img {
  max-width: 100%;
  border-radius: 8px;
  margin: 6px 0;
}
.dcBody h1, .dcBody h2, .dcBody h3 { color: #fff; margin: 6px 0 2px; }
.dcBody h1 { font-size: 16px; }
.dcBody h2 { font-size: 14px; }
.dcBody h3 { font-size: 13px; }
.dcBody p { margin: 2px 0; }
.dcBody p:empty { display: none; }
.dcBody br + br { display: none; }
.dcBody ul, .dcBody ol { padding-left: 18px; margin: 2px 0; }
.dcBody li { margin: 1px 0; }
.dcBody code { background: #2a2a2a; padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.dcBody pre { background: #2a2a2a; padding: 8px; border-radius: 6px; overflow-x: auto; margin: 6px 0; }
.dcBody pre code { background: none; padding: 0; }
.dcBody table { border-collapse: collapse; width: 100%; margin: 6px 0; }
.dcBody th, .dcBody td { border: 1px solid #444; padding: 4px 8px; text-align: left; font-size: 12px; }
.dcBody th { background: #2a2a2a; color: #ccc; }
.dcBody a { color: #64b5f6; }
.dcBody strong { color: #fff; }
.dcBody hr { margin: 4px 0; }
.dcBody blockquote { border-left: 3px solid #555; padding-left: 10px; color: #aaa; margin: 6px 0; }
.dcActions {
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  border-top: 1px solid #2a2a2a;
}
.dcActionBtn {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #444;
  background: transparent;
  color: #aaa;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.dcActionBtn:hover { color: #fff; border-color: #666; }
.dcActionBtn svg { width: 14px; height: 14px; }

.workSurface {
  max-width: 520px;
  width: 100%;
  margin: 8px auto 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  overflow: hidden;
}
.workSurfaceHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #bbb;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}
.workSurfaceClear {
  border: none;
  background: transparent;
  color: #888;
  font-size: 11px;
  padding: 2px 4px;
  cursor: pointer;
}
.workFeed { display: grid; gap: 1px; }
.workItem {
  display: grid;
  grid-template-columns: 7px 1fr auto;
  gap: 9px;
  align-items: start;
  padding: 9px 10px;
  background: rgba(0,0,0,0.16);
}
.workItemStripe {
  width: 3px;
  height: 100%;
  min-height: 28px;
  border-radius: 3px;
  background: #777;
}
.workItem[data-kind="ready"] .workItemStripe,
.workItem[data-kind="success"] .workItemStripe { background: #4ade80; }
.workItem[data-kind="working"] .workItemStripe,
.workItem[data-kind="media"] .workItemStripe { background: #64b5f6; }
.workItem[data-kind="warning"] .workItemStripe { background: #f5c842; }
.workItem[data-kind="error"] .workItemStripe { background: #f87171; }
.workItemTitle {
  color: #eee;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}
.workItemBody {
  color: #aaa;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 2px;
}
.workItemMeta {
  color: #777;
  font-size: 10px;
  white-space: nowrap;
  padding-top: 1px;
}

.chatInputSection {
  max-width: 520px;
  margin: 0 auto calc(10px + env(safe-area-inset-bottom, 0px));
  padding: 0 12px;
}
.chatInputRow {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 24px;
  padding: 4px 6px;
}
.chatInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  padding: 8px 4px;
  min-width: 0;
}
.chatInput::placeholder { color: #666; }
.attachBtn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: #888;
  flex-shrink: 0;
  border-radius: 50%;
  transition: color 0.2s;
}
.attachBtn:hover { color: #ccc; }
.attachBtn svg { width: 20px; height: 20px; }
.chatSendBtn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: none;
  background: #4CAF50;
  border-radius: 50%;
  cursor: pointer;
  color: white;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.2s;
}
.chatSendBtn:hover { background: #43a047; }
.chatSendBtn svg { width: 18px; height: 18px; }
.chatRecordBtn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: white;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.2s;
  opacity: 0.6;
}
.chatRecordBtn:hover { opacity: 1; }
.chatRecordBtn.recording { background: rgba(255,60,60,0.3); opacity: 1; animation: recordPulse 1s ease infinite; }
.chatRecordBtn svg { width: 18px; height: 18px; }
@keyframes recordPulse { 0%,100% { background: rgba(255,60,60,0.3); } 50% { background: rgba(255,60,60,0.5); } }

.cameraSection.disabled,
.chatInputSection.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.topBar {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* top bar stays at top on all screens */
.logoutIconBtn {
  border: none;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}
.engineToggle {
  border: 1px solid #444;
  background: transparent;
  color: #888;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  font-family: monospace;
}
.engineToggle:hover { color: #ccc; border-color: #666; }
.engineToggle.elevenlabs { color: #b388ff; border-color: #7c4dff; }
.engineToggle.gemini { color: #4fc3f7; border-color: #0288d1; }
.enginePicker {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(42px, 1fr));
  gap: 4px;
  min-width: 150px;
}
.engineOption {
  position: relative;
  border: 1px solid #333;
  background: rgba(255,255,255,0.04);
  color: #999;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.engineOption[aria-checked="true"] {
  color: #fff;
  border-color: #777;
  background: rgba(255,255,255,0.12);
}
.engineOption[data-engine="gemini"][aria-checked="true"] { border-color: #0288d1; }
.engineOption[data-engine="elevenlabs"][aria-checked="true"] { border-color: #7c4dff; }
.engineHealth {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #777;
}
.engineOption[data-available="true"] .engineHealth { background: #4ade80; }
.engineOption[data-available="false"] .engineHealth { background: #f87171; }
.engineOption[data-fallback="true"] { border-style: dashed; }

/* PTT toggle */
.pttToggle {
  border: 1px solid #444;
  background: transparent;
  color: #888;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  font-family: monospace;
}
.pttToggle:hover { color: #ccc; border-color: #666; }
.pttToggle.active { color: #ff9800; border-color: #ff9800; background: rgba(255,152,0,0.15); }

.actionBar .pttModeBtn {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.actionBar .pttModeBtn[aria-pressed="true"],
.actionBar .pttModeBtn.active {
  background: rgba(255, 152, 0, 0.22);
  color: #ffd08a;
  box-shadow: inset 0 -3px 0 rgba(255, 152, 0, 0.75);
}
.pttModeText { pointer-events: none; }

/* PTT hold button (fixed bottom bar during PTT mode) */
.pttHoldBtn {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: calc(84px + env(safe-area-inset-bottom, 0px));
  padding: 10px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  background: linear-gradient(180deg, rgba(255,152,0,0.18), rgba(255,152,0,0.34));
  border: 1px solid rgba(255,208,138,0.55);
  border-width: 1px 0 0;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 -10px 28px rgba(0,0,0,0.45);
}
.pttHoldBtn .pttText {
  color: #fff;
  text-transform: uppercase;
}
.pttHoldBtn .pttHint {
  color: rgba(255,255,255,0.74);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}
.pttHoldBtn.visible { display: flex; align-items: center; justify-content: center; }
.shell.pttActive { padding-bottom: 96px; }
.pttHoldBtn.held {
  background: linear-gradient(180deg, rgba(34,197,94,0.26), rgba(34,197,94,0.44));
  border-color: rgba(134,239,172,0.8);
  animation: pttRadiant 1.5s ease infinite;
  background-size: 200% 100%;
}
@keyframes pttRadiant {
  0% { background: linear-gradient(180deg, transparent 40%, rgba(120,120,120,0.08) 70%, rgba(200,200,200,0.25)); }
  50% { background: linear-gradient(180deg, transparent 20%, rgba(180,180,180,0.18) 50%, rgba(255,255,255,0.3)); }
  100% { background: linear-gradient(180deg, transparent 40%, rgba(120,120,120,0.08) 70%, rgba(200,200,200,0.25)); }
}
.pttHoldBtn.held .pttText {
  color: #fff;
  animation: pttTextShimmer 2s ease infinite;
}
@keyframes pttTextShimmer {
  0% { background-position: -100% 0; }
  100% { background-position: 100% 0; }
}
.mediaCard { padding: 10px; }
#mediaPreview {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #ececf1;
  background: #f7f7fa;
}

.advanced {
  max-width: 520px;
  margin-top: 2px;
  margin-left: auto;
  margin-right: auto;
  padding: 6px 8px;
  opacity: .7;
  font-size: 12px;
}
.advanced > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 18px;
  list-style: none;
  text-align: center;
}

.hasTip:not(.logoutIconBtn) { position: relative; }
.hasTip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--text) 92%, transparent);
  color: var(--bg);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.01s linear;
}
.voiceSelector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0 4px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.voiceLabel {
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 60px;
  text-align: center;
  text-transform: capitalize;
}
.voiceCycleBtn {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 0.75rem;
}
.voiceCycleBtn:hover { color: var(--text); border-color: var(--muted); }

.topBar .logoutIconBtn.hasTip::after,
.logoutIconBtn.hasTip::after {
  left: auto;
  right: calc(100% + 6px);
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
}
.hasTip:hover::after,
.hasTip:focus-visible::after,
.hasTip:focus-within::after {
  opacity: 1;
  animation: tipFade 3s forwards;
}
@keyframes tipFade {
  0%, 80% { opacity: 1; }
  100% { opacity: 0; }
}
.advanced > summary::-webkit-details-marker { display: none; }
.card { margin-top: 8px; padding: 8px; }
.row { display: flex; gap: 8px; align-items: center; }
input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font: inherit;
}
button { border-radius: 8px; border: 1px solid var(--line); background:#fff; padding: 8px 10px; }
h2 { margin: 0 0 6px; font-size: 12px; color: var(--muted); text-transform: lowercase; }
pre { margin:0; max-height:200px; overflow:auto; white-space:pre-wrap; font-size:12px; }
#assistantText .speaker { font-weight: 700; }

.authShell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.authCard {
  width: min(420px, 92vw);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  background: var(--card);
  text-align: center;
}
.authCard h1 {
  margin: 0 0 10px;
  font-size: 20px;
}
.authCard p {
  margin: 0 0 14px;
  color: var(--muted);
}
#gBtn {
  display: flex;
  justify-content: center;
  align-items: center;
}
.authError {
  margin-top: 12px;
  color: #d93025;
  font-size: 13px;
}

/* Action Cards */
/* Calendar event cards */
.calendarContainer { padding: 8px 10px !important; }
.calDayHeader {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: #888; padding: 8px 0 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 2px;
}
.calDayHeader:first-of-type { padding-top: 2px; }
.calDayHeader.calToday { color: #4ade80; }
.calEventRow {
  display: flex; gap: 10px; padding: 10px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.calEventRow:last-child { border-bottom: none; }
.calTimeCol {
  flex-shrink: 0; width: 52px; text-align: right;
  display: flex; flex-direction: column; align-items: flex-end; padding-top: 1px;
}
.calStartTime { font-size: 13px; font-weight: 600; color: #eee; line-height: 1.3; }
.calDuration { font-size: 10px; color: #666; margin-top: 1px; }
.calAccent {
  flex-shrink: 0; width: 3px; border-radius: 2px;
  background: linear-gradient(180deg, #4ade80, #22c55e); min-height: 28px;
  align-self: stretch;
}
.calEventInfo { flex: 1; min-width: 0; overflow: hidden; }
.calEventTitle { font-size: 13px; font-weight: 600; color: #eee; line-height: 1.3; }
.calEventMeta {
  font-size: 11px; color: #888; margin-top: 3px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.calEventBtns { display: flex; gap: 4px; margin-top: 6px; }

.actionCardsContainer { padding: 8px !important; }
.actionCardRow {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 8px; border-bottom: 1px solid #333;
  transition: opacity 0.3s;
}
.actionCardRow:last-of-type { border-bottom: none; }
.actionCardDone { opacity: 0.5; }
.actionCardCb { display: none; }
.actionCardInfo { flex: 1; min-width: 0; overflow: hidden; }
.actionCardHeader { display: flex; flex-direction: column; gap: 4px; }
.actionCardTopRow { display: flex; align-items: center; gap: 6px; }
.actionCardBtns { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 26px; }
.actionCardExpand {
  flex-shrink: 0; width: 20px; height: 20px; padding: 0;
  background: transparent !important; border: none !important;
  color: #888; font-size: 10px; cursor: pointer; transition: transform 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.actionCardExpand.expanded { transform: rotate(0deg); }
.actionCardTitleWrap { flex: 1; min-width: 0; overflow: hidden; }
.actionCardTitle { font-size: 13px; font-weight: 600; color: #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actionCardSub { font-size: 11px; color: #999; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actionCardSnippet { font-size: 11px; color: #777; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actionCardDetail {
  font-size: 11px; color: #aaa; margin-top: 6px; padding: 6px 8px 6px 26px;
  background: rgba(255,255,255,0.03); border-radius: 4px; line-height: 1.5;
}
.actionBtn {
  padding: 4px 8px; border-radius: 4px; border: 1px solid #555;
  background: #2a2a2a; color: #ccc; font-size: 11px; cursor: pointer;
  white-space: nowrap;
}
.actionBtn:hover { background: #383838; }
.actionBtn:disabled { opacity: 0.5; cursor: default; }
.cardBtn {
  padding: 4px 8px; border-radius: 4px; border: 1px solid #555;
  background: #2a2a2a; color: #ccc; font-size: 11px; cursor: pointer;
  white-space: nowrap;
}
.cardBtn:hover { background: #383838; }
.cardBtn:disabled { opacity: 0.5; cursor: default; }
.cardBtn-archive { color: #7cb3f5; border-color: #4a6fa5; }
.cardBtn-star { color: #f5c842; border-color: #a58a2a; }
.cardBtn-spam { color: #f5a623; border-color: #a57230; }
.cardBtn-delete { color: #f57c7c; border-color: #a54a4a; }
.cardBtn-mark_read { color: #aaa; border-color: #555; }
.actionDoneLabel { font-size: 11px; color: #6c6; }
.actionErrLabel { font-size: 11px; color: #f66; margin-left: 4px; }
.actionBatchBar {
  display: flex; gap: 8px; padding: 8px; border-top: 1px solid #444;
  justify-content: flex-end;
}

/* Camera Snapshot Button */
.cameraSnapBtn {
  position: absolute; bottom: 8px; left: 8px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.6);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0; backdrop-filter: blur(4px); transition: all 0.15s;
}
.cameraSnapBtn:hover { background: rgba(255,255,255,0.3); }
.cameraSnapBtn:active { transform: scale(0.9); }
.cameraSnapBtn svg { width: 20px; height: 20px; }
.cameraSnapBtn.snapped { background: rgba(100,200,100,0.4); border-color: #6c6; }

/* ── Settings hamburger + overlay ── */
.settingsBtn {
  position: fixed;
  top: max(6px, calc(env(safe-area-inset-top, 0px) + 6px));
  right: max(6px, calc(env(safe-area-inset-right, 0px) + 6px));
  z-index: 2147483647;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent !important;
  border-radius: 0 !important;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.settingsBtn { border: none !important; }
.hamburgerIcon {
  width: 28px;
  height: 28px;
  display: block;
}
.hamburgerIcon path {
  fill: #a8a8a8;
}
.settingsBtn:hover .hamburgerIcon path { fill: #d4d4d4; }
body.settingsOpen .settingsBtn {
  opacity: 0;
  pointer-events: none;
}

.settingsOverlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: flex-end;
}
.settingsOverlay[hidden] { display: none; }

.settingsPanel {
  width: min(300px, 80vw);
  height: 100%;
  background: #111;
  background-color: #111;
  border-left: 1px solid #333;
  z-index: 51;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideInRight 0.2s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.settingsHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  color: #eee;
  padding-bottom: 12px;
  border-bottom: 1px solid #333;
}
.settingsClose {
  border: none;
  background: transparent;
  color: #888;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}
.settingsClose:hover { color: #fff; }
.settingsItem {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ccc;
  font-size: 14px;
}
.settingsItem .voiceSelector {
  border-top: none;
  margin-top: 0;
  padding: 0;
  gap: 8px;
}
.settingsItem.logoutItem {
  margin-top: auto;
  justify-content: center;
}
.settingsItem .logoutBtn,
.logoutBtn {
  border: 1px solid #333;
  background: transparent;
  color: #888;
  font-size: 13px;
  padding: 12px 0;
  border-radius: 8px;
  cursor: pointer;
  width: 92%;
  text-align: center;
  margin: 0 auto;
}
.logoutBtn:hover { color: #ccc; border-color: #555; }

/* ── Bottom action bar ── */
.actionBar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 0;
  width: 76%;
  max-width: 340px;
  margin: 6px auto 0;
  background: rgba(30,30,30,0.95);
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}
.actionBar.disabled { opacity: 0.3; pointer-events: none; }

/* Chat bar — inside transcript card */
.chatBar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  padding: 8px 0 2px 0;
  margin-bottom: 3px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.chatAttachBtn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
  flex-shrink: 0;
  padding: 0;
  margin-bottom: 4px;
  -webkit-tap-highlight-color: transparent;
  z-index: 1;
}
.chatAttachBtn:hover { opacity: 1; }
.chatInputWrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: flex-end;
  background: rgba(255,255,255,0.08);
  border: 1px solid #555;
  border-radius: 12px;
  transition: border-color 0.15s;
  margin-right: 8px;
}
.chatInputWrap:focus-within { border-color: #888; }
.chatInput {
  flex: 1;
  box-sizing: border-box;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  padding: 10px 0 10px 14px;
  resize: none;
  outline: none;
  max-height: 100px;
  overflow-y: auto;
  line-height: 1.4;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.chatInput::placeholder { color: #666; }
.chatInputActions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 0;
  flex-shrink: 0;
}
.chatSendBtn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.chatSendBtn:hover { opacity: 1; }

.actionBar .actionBtn {
  flex: 1;
  height: 52px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 22px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.actionBar .actionBtn svg { width: 24px; height: 24px; pointer-events: none; }
.actionBar .actionBtn svg[hidden] { display: none; }
.actionBar .actionBtn:active { background: rgba(255,255,255,0.12); }
.actionBar .actionBtn:hover { background: rgba(255,255,255,0.08); }
.actionBar .actionBtn.active { background: rgba(255,255,255,0.15); }
.actionBar .actionBtn.muted { background: rgba(255,60,60,0.15); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 24px));
  z-index: 300;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(248,113,113,0.45);
  border-radius: 8px;
  background: rgba(24,24,24,0.96);
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}
.toast[hidden] { display: none; }
.toastText {
  min-width: 0;
  color: #f5f5f5;
  font-size: 13px;
  line-height: 1.35;
}
.toastActions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.toastBtn {
  border: 1px solid #444;
  background: rgba(255,255,255,0.08);
  color: #ddd;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
}
.toastBtn:hover,
.callStatusAction:hover,
.workSurfaceClear:hover { color: #fff; border-color: #666; }

/* ── More menu ── */
.moreMenu {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 14px;
  padding: 8px 0;
  min-width: 200px;
  z-index: 40;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.moreMenu[hidden] { display: none; }
.moreMenuItem {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: #eee;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.moreMenuItem svg { width: 18px; height: 18px; flex-shrink: 0; }
.moreMenuItem:hover { background: rgba(255,255,255,0.08); }

/* ── Transcript as panel (not details/summary) ── */
.transcriptDetails {
  max-width: 520px;
  width: 100%;
  margin: 2px auto 0;
  padding: 0;
}
.transcriptSummary {
  cursor: pointer;
  color: var(--muted);
  list-style: none;
  text-align: center;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.transcriptSummary::-webkit-details-marker { display: none; }
.transcriptSummary svg { width: 28px; height: 28px; transition: transform 0.2s, fill 0.3s; opacity: 0.5; }
.transcriptSummary:hover svg { opacity: 0.8; }
.transcriptSummary.hasNew svg { fill: #4ade80; opacity: 0.9; }
.transcriptDetails[open] .transcriptSummary svg { transform: rotate(180deg); }

/* Connecting line: clip to NOT overlap face buttons */
.stage::before {
  z-index: 0 !important;
}


/* Call dividers in transcript */
.transcript-divider {
  text-align: center;
  color: #888;
  font-size: 0.75em;
  padding: 8px 0;
  user-select: none;
}
