:root {
  color-scheme: dark;
  --bg: #101214;
  --panel: #181b1f;
  --panel-strong: #20252b;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f6f4ee;
  --muted: #a9adb5;
  --accent: #69d3b0;
  --accent-strong: #34b88d;
  --danger: #ff6b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: linear-gradient(135deg, #111716 0%, #101214 52%, #18150f 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow: hidden;
}

button,
textarea,
select {
  font: inherit;
}

.voice-shell {
  width: min(100%, 620px);
  height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
  overflow: hidden;
}

.price-banner {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.price-banner strong {
  color: var(--text);
  font-weight: 600;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.08;
  font-weight: 750;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.ghost-button,
.send-button,
.mic-button {
  border: 0;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ghost-button {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.ghost-button svg,
.send-button svg,
.mic-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.conversation {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 3px 0;
}

.empty-state {
  margin: auto 0;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
}

.empty-state strong {
  font-size: 19px;
}

.empty-state p {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.pulse-mark {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pulse-mark span {
  width: 9px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent);
  animation: pulseBar 1.2s ease-in-out infinite;
}

.pulse-mark span:nth-child(2) {
  height: 48px;
  animation-delay: 0.14s;
}

.pulse-mark span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes pulseBar {
  0%,
  100% {
    opacity: 0.45;
    transform: scaleY(0.72);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

.message {
  max-width: 88%;
  padding: 13px 14px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.42;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message.user {
  align-self: flex-end;
  background: #e9fff7;
  color: #10231d;
}

.message.assistant {
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
}

.message.meta {
  align-self: center;
  max-width: 100%;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--line);
  font-size: 13px;
}

.composer {
  background: rgba(24, 27, 31, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  gap: 12px;
  backdrop-filter: blur(18px);
}

.transcript-box textarea {
  width: 100%;
  min-height: 78px;
  resize: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 12px;
  outline: none;
  line-height: 1.45;
}

.transcript-box textarea:focus {
  border-color: rgba(105, 211, 176, 0.75);
}

.controls-row {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 10px;
  align-items: end;
}

.voice-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.voice-select-label {
  font-size: 11px;
  line-height: 1;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.voice-select {
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  padding: 0 10px;
  width: 100%;
  min-width: 0;
}

.send-button {
  height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #09231a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
  white-space: nowrap;
  width: 100%;
}

.send-button:disabled,
.mic-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mic-button {
  width: 76px;
  height: 76px;
  justify-self: center;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #082019;
  display: grid;
  place-items: center;
  box-shadow: 0 18px 46px rgba(52, 184, 141, 0.36);
}

.mic-button svg {
  width: 30px;
  height: 30px;
}

.mic-button.is-recording {
  background: linear-gradient(180deg, #ff8b8b, var(--danger));
  color: #2b0707;
  box-shadow: 0 18px 46px rgba(255, 107, 107, 0.3);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 16px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  width: min(100%, 380px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
}

.modal h2 {
  margin: 0;
  font-size: 18px;
}

.modal p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.tariff-list {
  display: grid;
  gap: 8px;
}

.tariff-button {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-strong);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.tariff-button:hover,
.tariff-button:active {
  background: rgba(105, 211, 176, 0.18);
  border-color: var(--accent);
}

.tariff-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.modal-close {
  height: 40px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.modal-step[hidden] {
  display: none;
}

.method-prompt {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.method-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.method-button {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

.method-button:hover,
.method-button:active {
  background: rgba(105, 211, 176, 0.18);
  border-color: var(--accent);
}

.method-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.method-button[hidden] {
  display: none;
}

.modal-back {
  height: 40px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}

@media (max-width: 420px) {
  .voice-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .send-button span {
    display: none;
  }

  .send-button {
    padding: 0 12px;
  }
}
