:root {
  color-scheme: dark;
  --bg: #101418;
  --panel: #172026;
  --text: #f4f7f8;
  --muted: #a9b6bd;
  --accent: #2fd17c;
  --accent-strong: #19b763;
  --danger: #ff6b5f;
  --border: #2b3942;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
}

.status-panel {
  padding-top: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.equipment-label {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: 0;
}

.status-text,
.hint {
  color: var(--muted);
  line-height: 1.45;
}

.auth-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.has-access-token .auth-panel {
  display: none;
}

.auth-panel label {
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-panel input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: #0c1115;
}

.auth-panel button {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  color: #04140b;
  background: var(--accent);
  font-weight: 700;
}

.controls {
  display: grid;
  place-items: center;
  gap: 14px;
  align-self: center;
}

.talk-button {
  width: min(72vw, 270px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  color: #04140b;
  background: var(--accent);
  font-size: 2rem;
  font-weight: 800;
  box-shadow: 0 0 0 10px rgba(47, 209, 124, 0.1);
}

.talk-button[aria-pressed="true"] {
  color: #fff;
  background: var(--danger);
  box-shadow: 0 0 0 10px rgba(255, 107, 95, 0.12);
}

.talk-button:active,
.auth-panel button:active,
.photo-button:active {
  transform: translateY(1px);
}

.photo-button {
  min-height: 46px;
  min-width: min(72vw, 270px);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #151f25;
  font-weight: 700;
}

.photo-button:disabled {
  opacity: 0.45;
}

.photo-strip {
  width: min(100%, 320px);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 64px;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
}

.photo-thumb {
  width: 64px;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
  background: #0c1115;
  overflow: hidden;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  background: rgba(7, 10, 12, 0.94);
}

.image-viewer[hidden] {
  display: none;
}

.image-viewer-close {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  color: var(--muted);
  background: transparent;
}

.image-viewer-close img {
  max-width: 100%;
  max-height: calc(100vh - 86px);
  object-fit: contain;
  border-radius: 8px;
}

.image-viewer-close span {
  font-size: 0.9rem;
}

.transcript {
  align-self: end;
  max-height: 30vh;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.message {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111a20;
  color: var(--text);
  line-height: 1.35;
}

.message.user {
  border-color: rgba(47, 209, 124, 0.45);
}

.message.assistant {
  border-color: rgba(169, 182, 189, 0.45);
}

@media (min-width: 760px) {
  .app-shell {
    padding-top: 44px;
  }
}
