:root {
  color-scheme: light;
  --ink: #242126;
  --soft-ink: #4f4952;
  --muted: #8b828d;
  --line: rgba(52, 42, 55, 0.1);
  --paper: #fbf8f6;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --accent: #b56f87;
  --accent-deep: #8d4d66;
  --accent-soft: #f6e8ee;
  --pearl: #f8f1ed;
  --sage: #dfe9e2;
  --deep: #2d2830;
  --green: #6f8f7d;
  --red: #bd5c61;
  --shadow: 0 18px 50px rgba(88, 66, 79, 0.12);
  --mini-shadow: 0 8px 24px rgba(88, 66, 79, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 232, 239, 0.82), transparent 32%),
    radial-gradient(circle at 92% 12%, rgba(223, 233, 226, 0.78), transparent 34%),
    linear-gradient(180deg, #fffdfb 0%, #fbf8f6 46%, #f7f1ee 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

.phone-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 138px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 248, 250, 0.76)),
    linear-gradient(135deg, rgba(181, 111, 135, 0.16), rgba(223, 233, 226, 0.34));
  box-shadow: var(--shadow);
  padding: 26px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.hero::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 24px;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(181, 111, 135, 0.18), rgba(255, 255, 255, 0.8)),
    linear-gradient(45deg, rgba(223, 233, 226, 0.52), transparent);
  box-shadow: inset 0 0 0 1px rgba(181, 111, 135, 0.1);
}

.hero p,
.hero h1,
.hero span {
  position: relative;
  z-index: 1;
  margin: 0;
}

.hero p {
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 100%;
  font-size: 29px;
  line-height: 1.18;
  margin-top: 8px;
  font-weight: 800;
}

.hero span {
  display: block;
  max-width: 100%;
  color: var(--soft-ink);
  font-size: 14px;
  line-height: 1.65;
  margin-top: 12px;
}

.session-card,
.chat-card,
.composer {
  width: 100%;
  max-width: 100%;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  box-shadow: var(--mini-shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.session-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.session-card.compact {
  grid-template-columns: 1fr 1fr;
}

.session-card.compact div {
  min-height: 72px;
  display: grid;
  gap: 8px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
  padding: 13px;
}

.session-card.compact strong {
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}

.session-card.compact span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  color: var(--deep);
  font-weight: 760;
  line-height: 1.35;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--soft-ink);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(52, 42, 55, 0.12);
  border-radius: 18px;
  padding: 14px 15px;
  outline: none;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

textarea {
  display: block;
  min-height: 118px;
  max-width: 100%;
  resize: vertical;
  line-height: 1.72;
}

textarea::placeholder {
  color: #b5adb6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(181, 111, 135, 0.48);
  box-shadow: 0 0 0 4px rgba(181, 111, 135, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.chat-card {
  min-height: 300px;
  padding: 16px;
}

.chat-log {
  max-height: 42vh;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding-right: 2px;
}

.message {
  display: grid;
  gap: 7px;
  max-width: 92%;
  padding: 13px 15px;
  border-radius: 20px;
  line-height: 1.66;
  border: 1px solid rgba(255, 255, 255, 0.58);
}

.message strong {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.message span {
  font-size: 15px;
}

.message.reporter {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 232, 238, 0.55));
  box-shadow: 0 8px 22px rgba(95, 68, 82, 0.08);
}

.message.founder {
  justify-self: end;
  color: #3b2430;
  background: linear-gradient(135deg, rgba(246, 232, 238, 0.92), rgba(255, 255, 255, 0.62));
  box-shadow: 0 8px 22px rgba(181, 111, 135, 0.1);
}

.composer {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 11px;
  padding: 16px;
  overflow: hidden;
}

.tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

button {
  border: 0;
  border-radius: 17px;
  min-height: 46px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 760;
  letter-spacing: 0;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, opacity 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

button:active {
  transform: scale(0.985);
}

button:disabled {
  cursor: default;
  opacity: 0.72;
}

.tools button {
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-deep);
  border: 1px solid rgba(181, 111, 135, 0.12);
  box-shadow: 0 8px 18px rgba(88, 66, 79, 0.06);
}

.primary {
  background: linear-gradient(135deg, #c47d96, #a75f78);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(181, 111, 135, 0.24);
}

.save {
  background: var(--deep);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(45, 40, 48, 0.18);
}

.recording {
  background: var(--red) !important;
  color: #ffffff !important;
}

.paused {
  background: #9b7a49 !important;
  color: #ffffff !important;
}

.voice-panel {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(181, 111, 135, 0.16);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(246, 232, 238, 0.42));
  padding: 13px;
}

.image-panel {
  display: grid;
  gap: 10px;
}

.image-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.image-button {
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(181, 111, 135, 0.14);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-deep);
  box-shadow: 0 8px 18px rgba(88, 66, 79, 0.06);
  font-size: 15px;
  font-weight: 760;
  cursor: pointer;
}

.image-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.image-preview {
  display: grid;
  gap: 10px;
}

.image-chip {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(52, 42, 55, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  padding: 9px;
}

.image-chip img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 14px;
  background: var(--pearl);
}

.image-chip div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.image-chip input {
  min-height: 38px;
  border-radius: 13px;
  padding: 9px 11px;
  font-size: 13px;
}

.image-chip button {
  justify-self: start;
  min-height: 32px;
  border-radius: 12px;
  padding: 6px 10px;
  background: rgba(45, 40, 48, 0.08);
  color: var(--soft-ink);
  box-shadow: none;
  font-size: 12px;
}

.image-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.voice-panel div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.voice-panel strong {
  color: var(--accent-deep);
  font-size: 13px;
}

.voice-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.voice-meter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 6px;
  height: 26px;
  padding: 4px 2px 2px;
}

.voice-meter span {
  display: block;
  height: 6px;
  min-height: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(196, 125, 150, 0.85), rgba(141, 77, 102, 0.95));
  transform-origin: bottom;
  opacity: 0.42;
  transition: height 120ms ease, opacity 120ms ease;
}

.voice-meter.active span {
  opacity: 0.78;
}

#liveTranscript {
  min-height: 48px;
  margin: 0;
  color: var(--ink);
  line-height: 1.65;
  white-space: pre-wrap;
}

.voice-hint {
  margin: -2px 0 0;
  color: var(--accent-deep);
  font-size: 12px;
  line-height: 1.55;
}

.save-toggle {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  width: fit-content;
  font-weight: 700;
  color: var(--soft-ink);
}

.save-toggle input {
  width: 19px;
  height: 19px;
  padding: 0;
  margin: 0;
  accent-color: var(--accent);
}

#statusText {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (min-width: 760px) {
  .phone-shell {
    max-width: 560px;
    padding-top: 28px;
  }
}

@media (max-width: 520px) {
  body {
    background:
      radial-gradient(circle at 18% 0%, rgba(255, 232, 239, 0.72), transparent 34%),
      radial-gradient(circle at 92% 8%, rgba(223, 233, 226, 0.62), transparent 36%),
      linear-gradient(180deg, #fffdfb 0%, #fbf8f6 52%, #f7f1ee 100%);
  }

  .phone-shell {
    max-width: none;
    padding: 12px;
    gap: 10px;
  }

  .hero {
    min-height: auto;
    border-radius: 22px;
    padding: 20px 18px;
  }

  .hero h1 {
    font-size: 25px;
  }

  .hero span {
    font-size: 13px;
    line-height: 1.6;
  }

  .hero::after {
    right: 16px;
    top: 16px;
    width: 42px;
    height: 42px;
    border-radius: 15px;
    opacity: 0.32;
  }

  .session-card,
  .chat-card,
  .composer {
    border-radius: 20px;
  }

  .session-card {
    padding: 12px;
  }

  .session-card.compact {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .session-card.compact div {
    min-height: 58px;
    border-radius: 16px;
    padding: 11px 12px;
  }

  .chat-card {
    min-height: 220px;
    padding: 14px;
  }

  .chat-log {
    max-height: 34vh;
  }

  .composer {
    padding: 14px;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
  }

  textarea {
    min-height: 108px;
    border-radius: 16px;
    padding: 13px 14px;
  }

  .tools {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .image-actions {
    gap: 9px;
  }

  .image-chip {
    grid-template-columns: 64px 1fr;
    border-radius: 16px;
  }

  .image-chip img {
    width: 64px;
    height: 64px;
    border-radius: 13px;
  }

  button {
    min-width: 0;
    padding: 10px 12px;
    white-space: nowrap;
  }

  #pauseButton {
    grid-column: 1 / -1;
  }
}
