﻿:root {
  color-scheme: dark;
  --bg: #030806;
  --surface: #0e1913;
  --text: #eff7f1;
  --muted: #acbdb2;
  --border: #30483a;
  --accent: #78f3a4;
  --soft: #172c20;
  --danger: #ffadb2;
  --danger-bg: #30181d;
  --warning: #ffd18a;
  --warning-bg: #2b2112;
  --shadow: 0 8px 28px #0006;
  --radius: 12px;
  --control-height: 48px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font:
    16px/1.55 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}
header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 860px;
  margin: auto;
  padding: calc(10px + env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right)) 10px
    max(18px, env(safe-area-inset-left));
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.8px;
}
.mark {
  display: block;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
}
main {
  max-width: 860px;
  margin: auto;
  padding: 0 max(18px, env(safe-area-inset-right))
    calc(24px + env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}
.portrait {
  position: relative;
  isolation: isolate;
  height: clamp(250px, calc(62vh - 70px), 540px);
  height: clamp(250px, calc(62svh - 70px), 540px);
  max-width: 660px;
  /* Run edge to edge on a phone: cancel the page's side padding. */
  margin: 0 calc(-1 * max(18px, env(safe-area-inset-right))) 0
    calc(-1 * max(18px, env(safe-area-inset-left)));
  overflow: hidden;
  pointer-events: none;
  /* Her shoulders and the numbers fade softly into the black below. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 80%, transparent);
  mask-image: linear-gradient(to bottom, #000 0, #000 80%, transparent);
}
.portrait canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* The numbers fade out at the sides, so no box edge shows. */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 9%,
    #000 91%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 9%,
    #000 91%,
    transparent
  );
}
.portrait img {
  position: relative;
  display: block;
  height: 100%;
  width: 100%;
  object-fit: contain;
}
.presence-status {
  margin: 2px 0 0;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-align: center;
  min-height: 23px;
}
body[data-state='unavailable'] .presence-status {
  color: var(--muted);
}
body[data-home='false'] .presence-status {
  text-align: left;
  margin-top: 16px;
}
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--muted);
  font-size: 12px;
}
body[data-home='true'] .status {
  justify-content: center;
}
#dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
#dot.online {
  background: var(--accent);
}
#lock {
  margin-left: auto;
}
body[data-home='true'] #lock {
  margin-left: 8px;
}
body[data-home='true'] #lock {
  min-height: 44px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  min-height: 48px;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 650;
}
button:hover {
  border-color: var(--accent);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.danger {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: var(--danger);
}
#stop {
  flex-shrink: 0;
}
.quiet {
  background: transparent;
  font-size: 13px;
  padding: 8px 10px;
}
.wide {
  width: 100%;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 750;
  color: var(--accent);
}
h1 {
  font-size: 29px;
  line-height: 1.2;
  letter-spacing: -0.7px;
  margin: 14px 0 18px;
}
h2 {
  font-size: 19px;
  margin-top: 28px;
}
#screen-lock {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}
#screen-lock h1 {
  font-size: 22px;
  margin: 3px 0 4px;
  font-weight: 600;
}
.lock-hint {
  font-size: 13px;
  margin: 0 0 12px;
}
#screen-lock > .primary {
  margin-bottom: 12px;
}
details {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
summary {
  cursor: pointer;
  font-size: 14px;
  padding: 10px 0;
}
#register {
  text-align: left;
}
label {
  display: block;
  font-size: 14px;
}
input:not([type='checkbox']),
select,
textarea {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  margin: 7px 0 15px;
}
input[type='checkbox'] {
  width: 19px;
  height: 19px;
  vertical-align: middle;
  accent-color: var(--accent);
}
nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  margin: 8px 0 24px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}
nav button {
  padding: 9px 2px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 12px;
  color: var(--muted);
}
nav button[aria-current='page'] {
  background: var(--soft);
  color: var(--accent);
}
#badge {
  display: inline-block;
  font-size: 10px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--soft);
  color: var(--text);
}
.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.section-heading h1 {
  font-size: 27px;
  margin-top: 0;
}
.speech {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
}
.speech label {
  font-size: 12px;
}
#messages {
  min-height: 180px;
  max-height: 48vh;
  overflow: auto;
  margin-bottom: 18px;
  padding: 2px;
}
.welcome {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 22px;
  background: var(--surface);
}
.bubble {
  padding: 15px 17px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 10px 0;
}
.bubble.user {
  background: var(--soft);
  margin-left: 24px;
}
.bubble.assistant {
  margin-right: 16px;
}
.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 4px;
}
.composer-footer .small {
  display: block;
  max-width: 215px;
  font-size: 11px;
}
#chat-form {
  background: var(--surface);
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
#prompt {
  border: 0;
  margin: 0;
  resize: vertical;
  min-height: 70px;
  box-shadow: none;
  background: transparent;
}
body[data-home='true'] #screen-chat > .section-heading h1,
body[data-home='true'] .speech,
body[data-home='true'] #messages {
  display: none;
}
body[data-home='true'] nav {
  margin: 4px 0 8px;
}
body[data-home='true'] nav button {
  min-height: 44px;
}
body[data-home='true'][data-signed-in='true'] .portrait {
  height: clamp(210px, calc(62vh - 110px), 500px);
  height: clamp(210px, calc(62svh - 110px), 500px);
}
.card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.card[data-risk='risky'] {
  border-color: var(--warning);
}
.card h2 {
  margin: 0;
  font-size: 18px;
}
.card pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
  max-height: 320px;
  font:
    13px/1.6 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 8px;
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.actions button {
  flex: 1 1 120px;
  min-height: var(--control-height);
  line-height: 1.2;
}
.actions button small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.75;
}
.card-sentence {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 14px;
}
.card[data-risk='risky'] .card-sentence {
  color: var(--warning);
}
.fields {
  margin: 0 0 12px;
}
.fields dt {
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.fields dd {
  margin: 2px 0 10px;
  padding: 10px 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 260px;
  overflow: auto;
  font:
    14px/1.5 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.exact {
  margin-bottom: 14px;
}
.exact summary {
  font-size: 12px;
  color: var(--muted);
}
.tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 750;
  color: var(--accent);
  margin-bottom: 8px;
}
.card[data-risk='risky'] .tag {
  color: var(--warning);
}
.entry {
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.entry summary {
  font-size: 13px;
}
.entry pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.code {
  font:
    24px ui-monospace,
    monospace;
  letter-spacing: 3px;
}
.pair-fingerprint {
  display: block;
  font-size: 14px;
  word-break: break-all;
}
.pc-source {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}
#pc-choice {
  min-height: 48px;
}
#notice {
  border: 1px solid var(--warning);
  background: var(--warning-bg);
  color: var(--warning);
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
}
footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
footer .small {
  width: 100%;
  font-size: 10px;
}
#app-fingerprint {
  font-family: ui-monospace, monospace;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}
.preview-controls {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}
.state-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.state-buttons button {
  flex: 1 1 95px;
  font-size: 13px;
}
.state-buttons button[aria-pressed='true'] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--soft);
}
.preview-home {
  max-width: 420px;
  margin: auto;
  text-align: center;
}
.preview-home h1 {
  font-size: 22px;
  margin: 3px 0 10px;
}
.preview-note {
  color: var(--muted);
  font-size: 12px;
}
.preview-controls h2 {
  margin-top: 0;
}
@media (min-width: 650px) {
  .portrait {
    margin: 0 auto;
  }
  main {
    padding-right: 35px;
    padding-left: 35px;
  }
  header {
    padding-right: 35px;
    padding-left: 35px;
  }
  nav button {
    font-size: 14px;
  }
  #messages {
    min-height: 270px;
  }
  body[data-home='true'] #workspace {
    max-width: 580px;
    margin: auto;
  }
}
/* Pass 6: glass surfaces and compositor-only decoration. */
header {
  background: #030806;
  border-color: #365640;
}
button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: var(--control-height);
  padding: 10px 16px;
  line-height: 1.4;
  border-radius: var(--radius);
  border-color: #3f7452;
  background: linear-gradient(160deg, #192d22, #0e1913);
  box-shadow:
    inset 0 1px #b7ffce0b,
    0 4px 12px #0003;
  transition:
    transform 100ms ease,
    opacity 100ms ease;
}
button:focus-visible {
  box-shadow:
    0 0 0 5px #78f3a419,
    0 0 22px #78f3a430;
}
button:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
  background: #254b34;
}
.primary {
  color: var(--bg);
  background: linear-gradient(140deg, #b0ffc9, #78f3a4);
  border-color: var(--accent);
}
.primary:active:not(:disabled) {
  background: #b0ffc9;
}
.quiet {
  background: #07110bb3;
  font-size: 13px;
}
button[aria-busy='true']::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #effff4, transparent);
  animation: edge-travel 1.1s linear infinite;
  pointer-events: none;
}
@keyframes edge-travel {
  to {
    transform: translateX(300%);
  }
}
/* Stop always occupies the same header slot, including while pressed/busy. */
#stop {
  z-index: 21;
  /* Owner 11/16: "Kill Switch", smaller box. Never below a 44 px tap. */
  min-width: 0;
  min-height: 44px;
  padding: 6px 12px;
  font-size: 13px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  color: var(--danger);
  background: var(--danger-bg);
  border-color: var(--danger);
  transform: none !important;
  animation: none !important;
  transition: none !important;
  opacity: 1;
}
#stop::before,
#stop::after {
  content: none !important;
}
nav {
  border-radius: 16px;
  background: linear-gradient(140deg, #14251bbf, #0e1913);
}
nav button {
  min-height: var(--control-height);
  border-radius: var(--radius);
  background: transparent;
  box-shadow: none;
}
body[data-home='true'] nav button,
body[data-home='true'] #lock {
  min-height: var(--control-height);
}
nav button[aria-current='page'] {
  box-shadow: inset 0 0 0 1px #78f3a440;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 20px;
}
input:not([type='checkbox']),
select,
textarea {
  border-radius: var(--radius);
}
.portrait {
  -webkit-mask-image: linear-gradient(#000 0, #000 88%, transparent);
  mask-image: linear-gradient(#000 0, #000 88%, transparent);
}
.portrait::after {
  content: '';
  position: absolute;
  inset: 10% 12% auto;
  height: 2px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, #baffd0, transparent);
  box-shadow: 0 -8px 24px #78f3a46b;
  pointer-events: none;
}
body[data-unlock='scanning'] .portrait::after {
  animation: scan 1.2s ease-in-out infinite;
}
@keyframes scan {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  15%,
  85% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(240px);
    opacity: 0;
  }
}
.signal {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: -8px auto 4px;
  pointer-events: none;
}
.signal i {
  width: 3px;
  height: 16px;
  border-radius: 4px;
  background: var(--accent);
  opacity: 0.45;
  transform: scaleY(0.25);
}
body[data-home='false'] .signal {
  display: none;
}
body[data-state='idle'] .signal i {
  animation: equalise 2.8s ease-in-out infinite;
}
body[data-state='listening'] .signal i {
  animation: equalise 700ms ease-in-out infinite;
}
body[data-state='speaking'] .signal i {
  /* Speech events/timing in look.ts drive this, including silent pauses. */
  animation: none;
  transform: scaleY(calc(0.2 + var(--voice, 0) * var(--bar, 0.8)));
  opacity: calc(0.3 + var(--voice, 0) * 0.6);
  transition:
    transform 90ms linear,
    opacity 90ms linear;
}
body[data-state='working'] .signal i {
  animation: equalise 1.4s ease-in-out infinite;
}
body[data-state='unavailable'] .signal i {
  background: var(--muted);
  opacity: 0.35;
}
.signal i:nth-child(3n) {
  animation-delay: -170ms !important;
}
.signal i:nth-child(3n + 1) {
  animation-delay: -330ms !important;
}
.signal i:nth-child(4n) {
  animation-delay: -510ms !important;
}
@keyframes equalise {
  50% {
    transform: scaleY(1);
    opacity: 0.9;
  }
}
.presence-status {
  font-size: 14px;
  letter-spacing: 0.5px;
}
.presence-status:empty {
  min-height: 0;
  margin: 0;
}
.card,
.welcome,
.bubble,
#chat-form,
.preview-controls,
.entry {
  position: relative;
  isolation: isolate;
  background-color: var(--surface);
  background-image:
    linear-gradient(#78f3a405 1px, transparent 1px),
    linear-gradient(90deg, #78f3a405 1px, transparent 1px),
    linear-gradient(145deg, #162b1f80, transparent 60%);
  background-size:
    28px 28px,
    28px 28px,
    auto;
  border: 1px solid #365640;
  border-radius: 16px;
  box-shadow:
    inset 0 1px #c3ffdb0c,
    var(--shadow);
}
.entry {
  padding: 12px;
  margin: 10px 0;
}
.card::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #78f3a416, transparent 65%);
  pointer-events: none;
}
.card:not(.approval-card)::before,
.approval-card[data-enter='true']::before {
  animation: panel-arrive 160ms ease-out;
}
@keyframes panel-arrive {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
/* Approval content and its buttons are visible and stationary from frame one.
   Only the decorative surface enters; amber breathing is an independent edge. */
.approval-card {
  background: var(--surface);
}
.approval-card,
.approval-card > *,
.approval-card .actions button {
  opacity: 1;
  transform: none;
  animation: none;
  transition: none;
}
.approval-card .actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.approval-card .actions button {
  height: 48px;
  min-height: var(--control-height);
  min-width: 0;
  padding: 6px;
  transform: none !important;
  animation: none !important;
  transition: none !important;
  opacity: 1;
}
.approval-card .actions button:disabled {
  cursor: not-allowed;
}
.approval-card .actions button::after {
  content: none;
}
.approval-card .actions small {
  opacity: 1;
}
.approval-card .fields dd {
  max-height: none;
  overflow: visible;
}
.approval-card .pc-source,
.approval-card .card-sentence,
.approval-card .fields dt,
.approval-card .exact summary {
  color: var(--text);
}
.tag {
  padding: 4px 8px;
  border: 1px solid #78f3a44a;
  border-radius: 6px;
  background: #102119;
}
.card[data-risk='risky'] .tag {
  background: #2b2112;
  border-color: #ffd18a66;
}
.card[data-risk='risky']::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 1px solid var(--warning);
  border-radius: inherit;
  pointer-events: none;
  animation: risk-edge 3.6s ease-in-out infinite;
}
@keyframes risk-edge {
  50% {
    opacity: 0.35;
  }
}
#chat-form {
  padding: 10px;
}
#chat-form::after,
.preview-composer::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 12px #78f3a470;
  transform: scaleX(0.3);
  transform-origin: center;
  transition: transform 180ms ease;
  pointer-events: none;
}
#chat-form:focus-within::after,
.preview-composer:focus-within::after {
  transform: scaleX(1);
}
.composer-footer {
  flex-wrap: wrap;
  gap: 8px;
}
.composer-footer > div {
  flex: 1 1 100%;
}
.composer-footer .small {
  max-width: none;
}
.send-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  font-size: 14px;
}
.send-control strong {
  overflow-wrap: anywhere;
  min-width: 0;
  font-weight: 650;
}
.send-control > span[aria-hidden] {
  font-size: 22px;
  line-height: 1;
}
.pc-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.pc-option {
  text-align: left;
  overflow-wrap: anywhere;
  font-size: 12px;
  padding: 10px;
}
.pc-option[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--soft);
}
.pc-tile > p:first-child {
  margin-top: 0;
  font-weight: 650;
}
.pc-tile > p:first-child::before,
.pc-option::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--muted);
}
[data-pc-state='online'] {
  --pc-color: var(--accent);
}
[data-pc-state='busy'] {
  --pc-color: var(--warning);
}
[data-pc-state='stopped'] {
  --pc-color: var(--danger);
}
[data-pc-state='offline'] {
  --pc-color: #acbdb2;
}
.pc-tile > p:first-child::before,
.pc-option::before {
  background: var(--pc-color, var(--muted));
}
[data-pc-changed='true'] > p:first-child::before,
.pc-option[data-pc-changed='true']::before {
  animation: state-pulse 500ms ease-out;
}
@keyframes state-pulse {
  50% {
    transform: scale(1.7);
    opacity: 0.55;
  }
}
.pc-tile small {
  display: block;
  overflow-wrap: anywhere;
  margin-bottom: 8px;
}
/* Security identifiers always use plain, unadorned monospace. */
code,
.code,
#code,
#app-fingerprint,
.pair-fingerprint {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: normal;
  text-shadow: none;
  filter: none;
  transform: none;
  animation: none;
  transition: none;
}
footer {
  align-items: baseline;
  gap: 4px 8px;
  margin-top: 24px;
  padding-top: 12px;
  font-size: 10px;
}
#app-fingerprint {
  overflow-wrap: anywhere;
}
.preview-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 8px;
  margin-bottom: 16px;
}
.preview-tabs button {
  flex: 0 0 auto;
  font-size: 12px;
}
.preview-tabs [aria-pressed='true'] {
  border-color: var(--accent);
  color: var(--accent);
}
.preview-home {
  text-align: left;
}
.preview-composer {
  position: relative;
  margin-top: 12px;
  padding: 10px;
  text-align: left;
}
.preview-home .preview-note {
  text-align: center;
}
.preview-controls {
  padding: 14px;
}
.preview-controls h2 {
  font-size: 18px;
}
.preview-controls p {
  margin: 6px 0 12px;
}
/* Pass 7: all effects are clipped to the portrait, outside every control. */
.portrait {
  pointer-events: auto;
  contain: layout paint;
}
.portrait canvas,
.lady-depth {
  pointer-events: none;
}
.lady-depth {
  position: absolute;
  inset: 0;
  transform-origin: 50% 45%;
}
.lady-visual {
  position: relative;
  height: 100%;
  aspect-ratio: 1128 / 1408;
  max-width: 100%;
  margin: auto;
  transform-origin: 50% 65%;
}
.lady-visual img,
.lady-visual video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lady-idle .lady-visual {
  animation: lady-breathe 5s ease-in-out infinite;
}
@keyframes lady-breathe {
  50% {
    transform: scale(1.012);
  }
}
.lady-drift,
.lady-face-light {
  position: absolute;
  pointer-events: none;
  opacity: 0;
}
.lady-drift {
  inset: 5% 27% 36%;
  border-radius: 50%;
  background: linear-gradient(
    100deg,
    transparent 30%,
    #baffe0 50%,
    transparent 70%
  );
}
.lady-idle .lady-drift {
  animation: lady-light-drift 7s ease-in-out infinite;
}
@keyframes lady-light-drift {
  0%,
  100% {
    transform: translateX(-35%);
    opacity: 0;
  }
  50% {
    transform: translateX(35%);
    opacity: 0.055;
  }
}
.lady-face-light {
  top: 39%;
  left: 28%;
  width: 45%;
  height: 19%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #baffe0, transparent 70%);
  transition: opacity 90ms linear;
}
body[data-speech='0'] {
  --voice: 0;
}
body[data-speech='1'] {
  --voice: 0.25;
}
body[data-speech='2'] {
  --voice: 0.5;
}
body[data-speech='3'] {
  --voice: 0.75;
}
body[data-speech='4'] {
  --voice: 1;
}
.lady-talking .lady-face-light {
  opacity: calc(var(--voice, 0) * 0.15);
}
.signal i:nth-child(2n) {
  --bar: 0.55;
}
.signal i:nth-child(3n) {
  --bar: 0.8;
}
.signal i:nth-child(4n) {
  --bar: 0.35;
}
.motion-controls {
  text-align: center;
  margin: 4px 0 12px;
}
.motion-controls p {
  margin: 4px 0;
}
body[data-home='false'] .motion-controls {
  display: none;
}
.this-device {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--accent);
}
body[data-page-hidden='true'] *,
body[data-page-hidden='true'] *::before,
body[data-page-hidden='true'] *::after {
  animation-play-state: paused !important;
  transition: none !important;
}
@media (max-width: 420px) {
  .portrait {
    height: clamp(250px, calc(52svh - 50px), 365px);
  }
  body[data-home='true'][data-signed-in='true'] .portrait {
    height: clamp(210px, calc(46svh - 50px), 325px);
  }
  .card {
    padding: 16px;
  }
  h1 {
    font-size: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lady-depth,
  .lady-visual {
    transform: none !important;
  }
  .lady-drift,
  .lady-face-light {
    opacity: 0 !important;
  }
  .signal i {
    transform: scaleY(0.25) !important;
    opacity: 0.45 !important;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* 11/16: the tilt switch is an extra, not a main control - keep it small. */
.motion-controls {
  margin: 2px 0 6px;
}
#enable-motion {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
}
#motion-status {
  margin: 2px 0 0;
  font-size: 11px;
}

/* 11/16: the still and the two clip layers swap by the hidden attribute;
   .portrait img sets display, so say it again here. */
.lady-visual img[hidden] {
  display: none;
}

/* 11/16: soft hand-over between the lady's clips. */
.lady-clip {
  transition: opacity 0.24s linear;
}
.lady-clip.lady-in {
  opacity: 0;
}
.lady-clip.lady-top {
  z-index: 1;
}

/* 11/16: hold-to-talk and the voice choice. */
.talk-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0 2px;
}
.talk {
  width: 100%;
  min-height: 52px;
  font-size: 15px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.talk.talking {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #78f3a455, 0 0 22px #78f3a433;
}
#talk-status:empty {
  display: none;
}
.voice-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.voice-pick select {
  max-width: 190px;
  min-height: 36px;
}

/* 11/16: conversation mode - the talk button turns into the send button. */
.talk.ready {
  color: #04140a;
  background: linear-gradient(160deg, #b6ffd0, #78f3a4);
  border-color: #b6ffd0;
  font-weight: 700;
}
#talk-mode {
  align-self: flex-start;
  min-height: 36px;
  font-size: 12px;
}
#talk-mode[aria-pressed='true'] {
  color: var(--accent);
  border-color: var(--accent);
}

/* 11/17: a playing clip moves by itself - no extra zoom, and no light
   patches that were placed for the still picture. */
.lady-live .lady-visual {
  animation: none !important;
  transform: none !important;
}
.lady-live .lady-drift,
.lady-live .lady-face-light {
  display: none !important;
}

/* 11/17 (owner: chat buttons looked bad on the phone). The top row of the
   Chat screen wrapped and cut off the Voice menu. Two tidy rows instead. */
.speech {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px 12px;
}
.speech > label:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 14px;
}
#stop-speaking {
  white-space: nowrap;
  min-height: 40px;
  padding: 6px 14px;
}
.voice-pick {
  grid-column: 1 / -1;
}
.voice-pick select {
  flex: 1;
  min-width: 0;
  max-width: none;
  min-height: 40px;
}
nav button {
  white-space: nowrap;
  padding-left: 8px;
  padding-right: 8px;
  font-size: 13px;
}
.talk-row {
  gap: 8px;
}
#talk-mode {
  align-self: stretch;
  min-height: 40px;
  font-size: 13px;
}
/* 11/17 (owner could not see replies): Home now shows Bejbi's latest reply.
   The whole conversation stays on the Chat screen. */
body[data-home='true'] #messages {
  display: block;
  max-height: 32vh;
  max-height: 32svh;
  overflow-y: auto;
  margin: 6px 0 10px;
}
body[data-home='true'] #messages > :not(:last-child),
body[data-home='true'] #messages > .welcome {
  display: none;
}

/* 11/17: five tabs must fit a phone without cutting "Approvals" off. */
nav {
  overflow-x: auto;
  scrollbar-width: none;
}
nav button {
  flex: 1 0 auto;
  font-size: 12.5px;
  padding-left: 7px;
  padding-right: 7px;
  letter-spacing: 0;
}
