/* Drive mode: Classic and CarPlay appearances, reply flow, quick replies, settings.
   Sizes are in em so the Text Size setting (--dv-scale, 100–135%) scales everything. */

.drive {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  font-size: calc(1rem * var(--dv-scale, 1));
  --dv-bg: #f2f2f7;
  --dv-card: #ffffff;
  --dv-card-2: #ffffff;
  --dv-pressed: rgba(118, 118, 128, 0.16);
  --dv-hairline: rgba(60, 60, 67, 0.14);
  background: var(--dv-bg);
  color: var(--label);
  animation: fade-in 0.25s var(--ease);
  user-select: none;
  -webkit-user-select: none;
}
@media (prefers-color-scheme: dark) {
  .drive {
    --dv-bg: #000000;
    --dv-card: #1c1c1e;
    --dv-card-2: #2c2c2e;
    --dv-pressed: rgba(118, 118, 128, 0.36);
    --dv-hairline: rgba(84, 84, 88, 0.5);
  }
}
.drive button { cursor: pointer; }
.drive button:disabled { cursor: default; }

/* ================================================================== Classic */

.dv-classic { height: 100%; display: flex; flex-direction: column; }
.dv-header {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.7em;
  height: 5.2em;
  padding: 0 1.4em;
}
.dv-title { font-size: 2.1em; font-weight: 750; letter-spacing: -0.03em; margin: 0 0 0 0.25em; line-height: 1; }
.dv-spacer { flex: 1; }
.dv-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  height: 3.1em;
  min-width: 64px;
  padding: 0 1.1em 0 0.9em;
  border: 0;
  border-radius: 999px;
  background: var(--dv-card);
  color: var(--blue);
  font-size: 1em;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.12s var(--ease), background-color 0.2s;
}
.dv-pill .i { font-size: 1.5em; }
.dv-pill:active, .dv-icon-btn:active { transform: scale(0.95); background: var(--dv-pressed); }
.dv-icon-btn {
  width: 3.1em;
  height: 3.1em;
  min-width: 64px;
  min-height: 64px;
  border: 0;
  border-radius: 50%;
  background: var(--dv-card);
  color: var(--blue);
  font-size: 1em;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.dv-icon-btn .i { font-size: 1.55em; }
.dv-announce { display: flex; align-items: center; gap: 0.1em; font-size: 0.95em; font-weight: 600; color: var(--label-2); padding-left: 0.6em; }
.dv-clock { font-size: 1.6em; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; min-width: 3.2em; text-align: right; }

.dv-body { flex: 1; min-height: 0; position: relative; }
.dv-home { height: 100%; display: flex; flex-direction: column; }
.dv-pages {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.dv-pages::-webkit-scrollbar { display: none; }
.dv-page {
  flex: none;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 2), minmax(0, 1fr));
  gap: 1.1em;
  padding: 0.4em 1.6em 0.6em;
}
.dv-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 1.4em;
  background: var(--dv-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  padding: 0.9em 1em;
  text-align: center;
  transition: transform 0.14s var(--ease), background-color 0.2s;
  overflow: hidden;
}
.dv-tile:active { transform: scale(0.97); background: var(--dv-pressed); }
.dv-tile-av { position: relative; margin-bottom: 0.3em; }
.dv-tile .avatar { --size: clamp(84px, 11vh, 124px); }
.dv-tile .avatar.avatar-group > .avatar { border-color: var(--dv-card); }
.dv-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 1.75em;
  height: 1.75em;
  padding: 0 0.45em;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 0.85em;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 3px solid var(--dv-card);
  font-variant-numeric: tabular-nums;
}
.dv-tile-name {
  max-width: 100%;
  font-size: 1.12em;
  font-weight: 650;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dv-tile-prev {
  max-width: 100%;
  font-size: 0.86em;
  color: var(--label-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dv-tile.unread .dv-tile-prev { color: var(--label); font-weight: 550; }
.dv-tile-time { position: absolute; top: 0.8em; right: 1em; font-size: 0.72em; color: var(--label-3); font-variant-numeric: tabular-nums; }
.dv-dots { flex: none; display: flex; justify-content: center; gap: 4px; height: 2.4em; align-items: center; }
.dv-dot { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; padding: 0; }
.dv-dot::after { content: ''; width: 11px; height: 11px; border-radius: 50%; background: var(--label-3); transition: background-color 0.2s; }
.dv-dot.on::after { background: var(--label); }
.dv-empty { margin: auto; color: var(--label-2); font-size: 1.1em; padding: 2em; text-align: center; }

/* conversation screen */
.dv-conv-title { display: flex; align-items: center; gap: 0.6em; min-width: 0; margin-left: 0.4em; }
.dv-conv-title .avatar { --size: 2.8em; }
.dv-conv-title h1 { font-size: 1.6em; font-weight: 700; letter-spacing: -0.02em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-conv { height: 100%; display: grid; grid-template-columns: minmax(300px, 30%) minmax(0, 1fr); gap: 1.4em; padding: 0.2em 1.6em 1.2em; }
.dv-actions { display: flex; flex-direction: column; gap: 0.8em; min-height: 0; }
.dv-big {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 3.9em;
  min-height: 88px;
  border: 0;
  border-radius: 1.2em;
  font-size: 1.12em;
  font-weight: 650;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--blue) 30%, transparent);
  transition: transform 0.12s var(--ease), filter 0.2s;
}
.dv-big .i { font-size: 1.5em; }
.dv-big:active { transform: scale(0.97); filter: brightness(0.92); }
.dv-big.play { background: var(--dv-card); color: var(--blue); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.dv-big.play.on { background: var(--blue); color: #fff; }
.dv-big.reply { background: var(--bubble-green); box-shadow: 0 6px 18px color-mix(in srgb, var(--bubble-green) 30%, transparent); }
.dv-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6em; align-content: start; }
.dv-chip {
  height: 4.3em;
  min-height: 80px;
  padding: 0.2em 0.7em;
  border: 0;
  border-radius: 1em;
  background: var(--dv-card);
  font-size: 0.9em;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.12s var(--ease), background-color 0.2s;
}
.dv-chip .emo { font-size: 1.9em; line-height: 1; }
.dv-chip:active { transform: scale(0.96); background: var(--dv-pressed); }
.dv-msgs {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.55em;
  overflow: hidden;
  padding: 0 0.4em;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 2.5em);
  mask-image: linear-gradient(to bottom, transparent 0, #000 2.5em);
}
.dv-stamp { align-self: center; font-size: 0.78em; color: var(--label-2); margin-bottom: 0.3em; }
.dv-msg { display: flex; flex-direction: column; align-items: flex-start; }
.dv-msg.me { align-items: flex-end; }
.dv-sender { font-size: 0.8em; color: var(--label-2); margin: 0 0 0.2em 0.9em; }
.dv-bubble {
  max-width: 88%;
  padding: 0.45em 0.8em 0.5em;
  border-radius: 1.1em;
  background: var(--bubble-gray);
  color: var(--on-gray);
  font-size: 1.42em;
  line-height: 1.28;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: box-shadow 0.25s var(--ease);
}
.dv-msg.me .dv-bubble { background: var(--bubble-blue); color: #fff; }
.dv-msg.me.sms .dv-bubble { background: var(--bubble-green); }
.dv-bubble.jumbo { background: transparent !important; font-size: 3.2em; padding: 0; }
.dv-att { display: inline-block; font-size: 0.75em; font-weight: 650; padding: 0.15em 0.55em; margin-right: 0.45em; border-radius: 0.6em; background: rgba(127, 127, 127, 0.2); vertical-align: 0.15em; }
.dv-msg.speaking .dv-bubble { box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 55%, transparent); }

/* sheet for Classic reply */
.dv-sheet-host { position: absolute; inset: 0; z-index: 5; pointer-events: none; display: flex; justify-content: center; align-items: flex-start; padding: 0.4em 1.6em; }
.dv-sheet-host.open { pointer-events: auto; background: rgba(0, 0, 0, 0.28); animation: fade-in 0.2s var(--ease); }
.dv-sheet-host .rf { width: min(100%, 1100px); background: var(--dv-card); border-radius: 1.6em; box-shadow: var(--shadow); padding: 1em 1.3em 1.2em; animation: sheet-in 0.32s var(--spring); }
@keyframes sheet-in { from { transform: translateY(-24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* incoming banner (Classic) */
.dv-banner {
  position: absolute;
  z-index: 8;
  top: 0.9em;
  left: 50%;
  width: min(820px, calc(100% - 32px));
  transform: translate(-50%, -160%);
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.8em 1.3em 0.8em 0.9em;
  border: 0;
  border-radius: 1.4em;
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--shadow), 0 0 0 1px var(--dv-hairline);
  text-align: left;
  transition: transform 0.45s var(--spring);
}
.dv-banner.show { transform: translate(-50%, 0); }
.dv-banner-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15em; }
.dv-banner-main strong { font-size: 1.2em; }
.dv-banner-main span { font-size: 1.1em; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-banner-cta { font-weight: 650; color: var(--blue); padding: 0.4em 0.8em; }

/* ================================================================== reply flow (both styles) */

.rf { display: flex; flex-direction: column; gap: 0.7em; }
.rf-head { display: flex; align-items: center; gap: 0.6em; }
.rf-to { flex: 1; min-width: 0; font-size: 1.05em; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-to b { color: var(--label); font-weight: 650; }
.rf-close {
  width: 64px;
  height: 64px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--fill);
  color: var(--label-2);
  font-size: 1.1em;
  display: grid;
  place-items: center;
}
.rf-close .i { font-size: 1.1em; }
.rf-stage { display: flex; align-items: center; gap: 1em; min-height: 5.2em; }
.rf[data-phase='type'] .rf-stage, .rf[data-phase='confirm'] .rf-stage { min-height: 0; }
.rf[data-phase='type'] .orb, .rf[data-phase='confirm'] .orb { display: none; }
.rf-stage-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2em; }
.rf-status { font-size: 1.05em; font-weight: 600; color: var(--label-2); }
.rf.error .rf-status { color: var(--red); }
.rf-caption { font-size: 1.6em; font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; color: var(--label); overflow-wrap: anywhere; }
.rf-caption:empty { display: none; }
.rf-time { font-size: 0.85em; color: var(--label-3); font-variant-numeric: tabular-nums; }
.rf-field {
  display: none;
  width: 100%;
  min-height: 3.4em;
  max-height: 7.5em;
  padding: 0.6em 0.8em;
  border: 1.5px solid var(--separator-strong);
  border-radius: 1em;
  background: var(--bg);
  color: var(--label);
  font: inherit;
  font-size: 1.4em;
  line-height: 1.3;
  resize: none;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.rf-field:focus { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 20%, transparent); }
.rf[data-phase='type'] .rf-field, .rf[data-phase='confirm'] .rf-field { display: block; }
.rf-tip { display: none; align-items: center; gap: 0.45em; margin: 0; font-size: 0.9em; color: var(--label-2); }
.rf-tip .i { font-size: 1.15em; color: var(--blue); }
.rf[data-phase='type'] .rf-tip { display: flex; }
.rf-buttons { display: flex; gap: 0.7em; justify-content: flex-end; flex-wrap: wrap; }
.rf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-width: 7.5em;
  height: 3.3em;
  min-height: 72px;
  padding: 0 1.3em;
  border: 0;
  border-radius: 999px;
  font-size: 1.05em;
  font-weight: 650;
  background: var(--fill);
  color: var(--blue);
  transition: transform 0.12s var(--ease), opacity 0.2s, filter 0.2s;
}
.rf-btn .i { font-size: 1.3em; }
.rf-btn:active { transform: scale(0.96); }
.rf-btn.go { background: var(--blue); color: #fff; min-width: 9em; }
.rf-btn.go:disabled { opacity: 0.4; }
.rf-btn.stop { background: var(--red); color: #fff; min-width: 9em; }
.rf-btn.plain:first-child { margin-right: auto; color: var(--label); }

/* Siri-like orb: reacts to the input level (--lvl) */
.orb { position: relative; width: 4.6em; height: 4.6em; flex: none; --lvl: 0; }
.orb-core {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #37d0ff, #7b61ff, #ff4fd8, #ff9f0a, #37d0ff);
  filter: blur(1px) saturate(1.2);
  transform: scale(calc(0.82 + var(--lvl) * 0.35));
  transition: transform 0.08s linear;
  animation: orb-spin 3.2s linear infinite;
  box-shadow: 0 0 28px rgba(123, 97, 255, 0.55);
}
.orb-core::after { content: ''; position: absolute; inset: 18%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.15) 60%, transparent 70%); }
.orb-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(123, 97, 255, 0.45); opacity: 0; }
.hot .orb-ring, .speaking .orb-ring { animation: orb-ring 1.8s ease-out infinite; }
.hot .orb-ring.r2, .speaking .orb-ring.r2 { animation-delay: 0.9s; }
.rf[data-phase='transcribing'] .orb-core { animation-duration: 0.9s; }
@keyframes orb-spin { to { rotate: 360deg; } }
@keyframes orb-ring { 0% { transform: scale(0.7); opacity: 0.9; } 100% { transform: scale(1.35); opacity: 0; } }

/* ================================================================== toast (undo) */

.dv-toast {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: 1.4em;
  transform: translate(-50%, 180%);
  display: flex;
  align-items: center;
  gap: 0.8em;
  width: min(760px, calc(100% - 32px));
  min-height: 5em;
  padding: 0.7em 0.8em 0.7em 1.1em;
  border-radius: 1.5em;
  background: var(--elevated);
  box-shadow: var(--shadow), 0 0 0 1px var(--dv-hairline);
  overflow: hidden;
  transition: transform 0.4s var(--spring);
}
.dv-toast.show { transform: translate(-50%, 0); }
.dv-toast-ic { width: 2.2em; height: 2.2em; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); color: var(--label-2); font-size: 1.1em; }
.dv-toast-ic.ok { background: var(--bubble-green); color: #fff; }
.dv-toast-ic.bad { background: transparent; color: var(--red); font-size: 1.6em; }
.dv-toast-ic .i { font-size: 1.1em; }
.dv-toast-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1em; }
.dv-toast-main strong { font-size: 1.08em; }
.dv-toast-main span { font-size: 0.92em; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-toast-btn {
  flex: none;
  min-width: 6.2em;
  height: 3.3em;
  min-height: 72px;
  padding: 0 1.2em;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue) !important;
  font-size: 1.05em;
  font-weight: 700;
}
.dv-toast-btn:disabled { opacity: 0.4; }
.dv-toast-x { width: 64px; height: 64px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--label-2); display: grid; place-items: center; font-size: 1em; }
.dv-toast-bar { position: absolute; left: 0; bottom: 0; height: 5px; width: 100%; background: var(--blue); transform-origin: left; animation: undo-bar 3s linear forwards; }
@keyframes undo-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ================================================================== settings */

.ds-backdrop { position: absolute; inset: 0; z-index: 45; background: rgba(0, 0, 0, 0.35); display: grid; place-items: center; padding: 1em; animation: fade-in 0.2s var(--ease); }
.ds {
  width: min(860px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: var(--dv-bg);
  border-radius: 1.8em;
  box-shadow: var(--shadow);
  padding: 0.6em 1.2em 1.2em;
  animation: sheet-in 0.3s var(--spring);
}
.ds-head { display: flex; align-items: center; justify-content: space-between; height: 4.2em; }
.ds-head h2 { margin: 0; font-size: 1.45em; font-weight: 700; letter-spacing: -0.02em; }
.ds-done { min-height: 64px; min-width: 6em; border: 0; border-radius: 999px; background: transparent; color: var(--blue) !important; font-weight: 700; font-size: 1.05em; }
.ds-rows { background: var(--dv-card); border-radius: 1.2em; padding: 0 1em; }
.ds-row { display: flex; align-items: center; gap: 1em; min-height: 4.4em; padding: 0.5em 0; }
.ds-row + .ds-row { border-top: 1px solid var(--dv-hairline); }
.ds-label { flex: 1; min-width: 6em; font-size: 1.02em; font-weight: 600; }
.ds-label small { display: block; font-size: 0.8em; font-weight: 400; color: var(--label-2); margin-top: 0.2em; line-height: 1.3; }
.seg { display: flex; padding: 4px; border-radius: 16px; background: var(--fill); gap: 4px; }
.seg-btn { min-width: 7em; min-height: 64px; border: 0; border-radius: 12px; background: transparent; font-size: 1em; font-weight: 600; }
.seg-btn.on { background: var(--dv-card-2); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.ds-scale { display: flex; align-items: center; gap: 0.6em; }
.ds-scale .a-sm { font-size: 0.8em; font-weight: 600; }
.ds-scale .a-lg { font-size: 1.3em; font-weight: 600; }
.ds-val { min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; color: var(--label-2); }
.ds-range { width: min(16em, 28vw); height: 64px; accent-color: var(--blue); background: transparent; }
.ds-range::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: var(--fill-2); }
.ds-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 40px; height: 40px; margin-top: -16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.ds-range { -webkit-appearance: none; appearance: none; }
.ds-exit { width: 100%; margin-top: 1em; min-height: 76px; border: 0; border-radius: 1.2em; background: var(--dv-card); color: var(--blue) !important; font-size: 1.05em; font-weight: 650; }

/* ================================================================== CarPlay */

.drive.carplay {
  color-scheme: dark;
  --label: #ffffff;
  --label-2: rgba(235, 235, 245, 0.66);
  --label-3: rgba(235, 235, 245, 0.34);
  --separator: rgba(255, 255, 255, 0.14);
  --separator-strong: rgba(255, 255, 255, 0.28);
  --fill: rgba(255, 255, 255, 0.12);
  --fill-2: rgba(255, 255, 255, 0.2);
  --fill-pressed: rgba(255, 255, 255, 0.26);
  --bg: #0b0b0f;
  --elevated: rgba(44, 44, 50, 0.92);
  --blue: #0a84ff;
  --bubble-blue: #0a84ff;
  --bubble-green: #30d158;
  --bubble-gray: #2c2c2e;
  --on-gray: #fff;
  --red: #ff453a;
  --material: rgba(30, 30, 36, 0.7);
  --avatar-top: #6d6d74;
  --avatar-bottom: #4b4b51;
  --dv-bg: #0b0b0f;
  --dv-card: rgba(58, 58, 64, 0.72);
  --dv-card-2: rgba(92, 92, 100, 0.9);
  --dv-hairline: rgba(255, 255, 255, 0.12);
  --glass: rgba(40, 40, 48, 0.46);
  --glass-strong: rgba(30, 30, 38, 0.88);
  --glass-edge: rgba(255, 255, 255, 0.22);
  --glass-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
  background: #05060a;
  color: #fff;
}
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(40px) saturate(170%);
  backdrop-filter: blur(40px) saturate(170%);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-edge), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.cp { position: relative; height: 100%; display: grid; grid-template-columns: 8.2em minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.cp-wall {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 80% at 15% 10%, rgba(64, 90, 255, 0.35), transparent 60%),
    radial-gradient(55% 70% at 90% 90%, rgba(0, 190, 170, 0.28), transparent 60%),
    radial-gradient(40% 50% at 70% 20%, rgba(190, 70, 255, 0.22), transparent 60%),
    linear-gradient(160deg, #0b1020, #05060a 60%, #07120f);
}

/* status bar */
.cp-status {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6em;
  padding: 1.1em 0 1em;
  background: rgba(10, 10, 14, 0.55);
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}
.cp-time { font-size: 1.35em; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cp-net { display: flex; align-items: center; gap: 0.3em; font-size: 0.72em; font-weight: 700; color: rgba(255, 255, 255, 0.85); }
.cp-net .i { font-size: 1.3em; }
.cp-apps { display: flex; flex-direction: column; gap: 0.9em; margin-top: 1.2em; }
.cp-app {
  position: relative;
  width: 4.2em;
  height: 4.2em;
  min-width: 72px;
  min-height: 72px;
  border: 0;
  border-radius: 1.05em;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: visible;
  transition: transform 0.14s var(--ease);
}
.cp-app:active { transform: scale(0.92); }
.cp-app img { width: 100%; height: 100%; border-radius: inherit; display: block; }
.cp-app.active::before {
  content: '';
  position: absolute;
  left: -0.75em;
  top: 50%;
  width: 5px;
  height: 1.6em;
  margin-top: -0.8em;
  border-radius: 3px;
  background: #fff;
}
.cp-app.layout { background: linear-gradient(180deg, #5ac8fa, #0a84ff); color: #fff; font-size: 1em; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.cp-app.settings { background: linear-gradient(180deg, #a1a1a8, #636369); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.cp-app .i { font-size: 2.2em; }
.cp-grow { flex: 1; }
.cp-home {
  width: 4.2em;
  height: 4.2em;
  min-width: 72px;
  min-height: 72px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 20px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.cp-home .i { font-size: 1.6em; }
.cp-home:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.2); }

/* Messages window */
.cp-main { position: relative; z-index: 1; min-width: 0; min-height: 0; padding: 1em 1.1em 1em 1em; }
.cp-window { height: 100%; border-radius: 2em; display: flex; flex-direction: column; overflow: hidden; }
.cp-titlebar { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 4.6em; padding: 0 0.9em; }
.cp-titlebar h1 { margin: 0; font-size: 1.35em; font-weight: 700; letter-spacing: -0.015em; }
.cp-compose {
  justify-self: end;
  width: 3.4em;
  height: 3.4em;
  min-width: 64px;
  min-height: 64px;
  border-radius: 50%;
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
}
.cp-compose .i { font-size: 1.6em; }
.cp-compose:active { background: rgba(255, 255, 255, 0.24); transform: scale(0.94); }
.cp-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 0 1em 1em; }
.cp-scroll::-webkit-scrollbar { display: none; }
.cp-pins { display: flex; justify-content: space-around; gap: 0.5em; padding: 0.4em 0 1.2em; border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 0.5em; }
.cp-pin { flex: 0 1 9em; min-width: 0; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 0.5em; padding: 0.4em; border-radius: 1.2em; }
.cp-pin:active { background: rgba(255, 255, 255, 0.08); }
.cp-pin:focus:not(:focus-visible), .cp-row:focus:not(:focus-visible) { outline: none; background: transparent; }
.cp-pin-av { position: relative; }
.cp-pin .avatar { --size: clamp(92px, 12vh, 128px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); }
.cp-pin .avatar.avatar-group > .avatar { border-color: #1a1a20; }
.cp-pin-name { max-width: 100%; font-size: 1em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-pin .cp-dot { position: absolute; top: 4px; left: 4px; width: 1.05em; height: 1.05em; border: 3px solid #15151b; }
.cp-dot { width: 0.75em; height: 0.75em; border-radius: 50%; background: transparent; flex: none; }
.unread .cp-dot { background: var(--blue); }
.cp-list { display: flex; flex-direction: column; }
.cp-row {
  display: flex;
  align-items: center;
  gap: 0.8em;
  min-height: 5.2em;
  padding: 0.5em 0.9em 0.5em 0.5em;
  border: 0;
  border-radius: 1.2em;
  background: transparent;
  text-align: left;
  position: relative;
}
.cp-row + .cp-row::before { content: ''; position: absolute; top: 0; left: 5.6em; right: 0.9em; height: 1px; background: rgba(255, 255, 255, 0.1); }
.cp-row:active { background: rgba(255, 255, 255, 0.1); }
.cp-row .avatar { --size: 3.3em; }
.cp-row-name { flex: 1; min-width: 0; font-size: 1.12em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-row-time { font-size: 0.85em; color: var(--label-2); font-variant-numeric: tabular-nums; }
.cp-empty { padding: 2em; text-align: center; color: var(--label-2); font-size: 1.05em; }

/* incoming banner (compact Liquid Glass) */
.cp-banner {
  position: absolute;
  z-index: 6;
  top: 1.6em;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 0.7em;
  width: min(34em, calc(100% - 3em));
  min-height: 4.6em;
  padding: 0.6em 1.4em 0.6em 0.7em;
  border: 0;
  border-radius: 2.4em;
  text-align: left;
  transform: translate(-50%, -180%);
  transition: transform 0.45s var(--spring);
  background: rgba(38, 38, 46, 0.88);
}
.cp-banner.show { transform: translate(-50%, 0); }
.cp-banner-main { display: flex; flex-direction: column; min-width: 0; }
.cp-banner-main strong { font-size: 1.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-banner-main span { font-size: 0.9em; color: var(--label-2); }

/* Siri card */
.cp-siri { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: center; padding: 1em; }
.cp-siri.top, .cp-siri:has(.rf[data-phase='type']) { align-items: flex-start; }
.cp-siri-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); animation: fade-in 0.25s var(--ease); }
.cp-siri-card {
  position: relative;
  width: min(1100px, 100%);
  max-height: 100%;
  overflow-y: auto;
  border-radius: 2.2em;
  padding: 1.1em 1.3em 1.2em;
  display: flex;
  flex-direction: column;
  gap: 0.9em;
  background: var(--glass-strong);
  animation: siri-in 0.42s var(--spring);
}
@keyframes siri-in { from { transform: translateY(40px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.cp-siri-head { display: flex; align-items: center; gap: 0.8em; }
.cp-siri-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1em; }
.cp-siri-who strong { font-size: 1.4em; font-weight: 700; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-siri-sub { font-size: 0.95em; color: var(--label-2); }
.cp-siri-x { width: 64px; height: 64px; flex: none; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; display: grid; place-items: center; font-size: 1em; }
.cp-captions { display: none; flex-direction: column; gap: 0.5em; }
.cp-siri-card.captions .cp-captions { display: flex; }
.cp-captions:empty { display: none !important; }
.cp-cap { margin: 0; font-size: 1.55em; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; color: rgba(255, 255, 255, 0.75); transition: color 0.2s; }
.cp-cap.now { color: #fff; }
.cp-siri-actions { display: flex; gap: 0.8em; }
.cp-siri-actions:empty, .cp-quick:empty, .cp-flow:empty { display: none; }
.cp-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  height: 3.6em;
  min-height: 80px;
  border: 0;
  border-radius: 1.8em;
  font-size: 1.12em;
  font-weight: 650;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.12s var(--ease), background-color 0.2s;
}
.cp-btn .i { font-size: 1.45em; }
.cp-btn:active { transform: scale(0.97); background: rgba(255, 255, 255, 0.22); }
.cp-btn.primary { background: var(--blue); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 24px rgba(10, 132, 255, 0.35); }
.cp-btn.stop { background: rgba(255, 255, 255, 0.16); }
.cp-quick { display: flex; flex-wrap: wrap; gap: 0.6em; }
.cp-quick::-webkit-scrollbar { display: none; }
.cp-chip {
  flex: none;
  min-height: 68px;
  padding: 0 1.1em;
  border: 0;
  border-radius: 999px;
  font-size: 0.98em;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}
.cp-chip:active { background: rgba(255, 255, 255, 0.22); }
.cp-siri-orb { display: flex; justify-content: center; margin-top: -0.2em; }
.cp-siri-card[data-phase='reply'] .cp-siri-orb, .cp-siri-card[data-phase='pick'] .cp-siri-orb { display: none; }
.cp-siri-card[data-phase='actions'] .orb { opacity: 0.55; }
.cp-siri-card[data-phase='actions'] .orb-core { animation-duration: 8s; }
.cp-flow .rf { gap: 0.8em; }
.cp-flow .rf-head { display: none; }
.cp-flow .rf-caption { font-size: 1.8em; }
.cp-flow .rf-field { background: rgba(0, 0, 0, 0.35); border-color: rgba(255, 255, 255, 0.2); }
.cp-flow .rf-btn { background: rgba(255, 255, 255, 0.14); color: #fff; border-radius: 1.8em; }
.cp-flow .rf-btn.go { background: var(--blue); }
.cp-flow .rf-btn.stop { background: var(--red); }
.cp-to {
  width: 100%;
  min-height: 76px;
  padding: 0 0.9em;
  border-radius: 1.1em;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: inherit;
  font-size: 1.3em;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.cp-to:focus { border-color: var(--blue); }
.cp-flow > .rf-tip { display: flex; margin-top: 0.5em; }
.cp-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); gap: 0.5em; margin-top: 0.7em; }
.cp-pick-row { display: flex; align-items: center; gap: 0.7em; min-height: 5em; padding: 0.5em 0.8em; border: 0; border-radius: 1.2em; background: rgba(255, 255, 255, 0.08); text-align: left; }
.cp-pick-row:active { background: rgba(255, 255, 255, 0.18); }
.cp-pick-main { display: flex; flex-direction: column; min-width: 0; }
.cp-pick-main strong { font-size: 1.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-pick-main span { font-size: 0.85em; color: var(--label-2); }
.carplay .dv-toast { background: var(--glass-strong); -webkit-backdrop-filter: blur(40px) saturate(170%); backdrop-filter: blur(40px) saturate(170%); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-edge); border-radius: 2em; left: calc(50% + 4.1em); }
.carplay .ds { background: rgba(28, 28, 34, 0.9); -webkit-backdrop-filter: blur(40px); backdrop-filter: blur(40px); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-edge); }
.carplay .ds-rows { background: rgba(255, 255, 255, 0.07); }
.carplay .seg-btn.on { background: rgba(255, 255, 255, 0.24); }
.carplay .ds-exit { background: rgba(255, 255, 255, 0.07); }

@media (max-width: 1279px) {
  .dv-conv { grid-template-columns: minmax(280px, 34%) minmax(0, 1fr); }
  .cp { grid-template-columns: 7.2em minmax(0, 1fr); }
  .cp-app, .cp-home { width: 3.8em; height: 3.8em; }
}
@media (max-height: 820px) {
  .dv-header { height: 4.4em; }
  .dv-chip { height: 3.5em; }
  .dv-big { height: 3.4em; }
  .cp-titlebar { height: 3.9em; }
  .cp-pins { padding-bottom: 0.8em; }
  .cp-apps { margin-top: 0.6em; gap: 0.6em; }
}
