:root {
  --bg: #f7f3ec;
  --bg-deep: #f1ebe1;
  --panel: rgba(255, 252, 247, 0.88);
  --panel-strong: rgba(255, 250, 243, 0.98);
  --ink: #201c17;
  --muted: #6f665b;
  --line: rgba(62, 44, 23, 0.12);
  --link: #136f63;
  --chip-bg: #e4efe8;
  --chip-ink: #24584f;
  --accent-soft: #eef5f2;
  --accent-warm: #fff3e9;
  --shadow: 0 24px 70px rgba(76, 57, 29, 0.12);
  --shadow-strong: 0 28px 90px rgba(66, 47, 21, 0.14);
}

* {
  box-sizing: border-box;
}

[v-cloak] {
  visibility: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(217, 121, 65, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(19, 111, 99, 0.07), transparent 24%),
    linear-gradient(180deg, #faf7f1 0%, var(--bg) 58%, var(--bg-deep) 100%);
  color: var(--ink);
  font: 16px/1.5 "Avenir Next", "Segoe UI", sans-serif;
  padding-bottom: 140px;
}

.app-shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 52px 0 72px;
}

.hero {
  display: block;
  margin-bottom: 28px;
  min-height: 48px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 12ch;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.log-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(62, 44, 23, 0.1);
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 999px;
  font: 600 0.95rem/1 "Avenir Next", "Segoe UI", sans-serif;
  cursor: pointer;
}

.filter-toggle.is-open {
  background: var(--link);
  color: white;
  border-color: var(--link);
}

.filter-toggle-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.1;
}

.filter-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(340px, calc(100vw - 32px));
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 251, 244, 0.96);
  border: 1px solid rgba(62, 44, 23, 0.1);
  box-shadow: 0 24px 60px rgba(66, 47, 21, 0.14);
  backdrop-filter: blur(18px);
  z-index: 40;
}

.list-filter {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.section-heading {
  margin-bottom: 16px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.panel-title {
  font-size: 1.55rem;
  line-height: 1.03;
  letter-spacing: -0.03em;
}

.panel-subtitle {
  max-width: 28ch;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.35;
  text-align: right;
}

.section-kicker,
.history-date,
.history-time {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-list {
  display: grid;
  gap: 0;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.composer-shell {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 18px;
  z-index: 30;
}

.composer {
  position: relative;
  width: min(860px, 100%);
  pointer-events: auto;
  background: rgba(255, 251, 244, 0.9);
  border: 1px solid rgba(62, 44, 23, 0.1);
  box-shadow: 0 20px 60px rgba(76, 57, 29, 0.14);
  border-radius: 24px;
  backdrop-filter: blur(18px);
  padding: 12px 12px 18px;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, background 220ms ease;
}

.composer.is-recording {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(19, 111, 99, 0.24);
  box-shadow: 0 28px 80px rgba(19, 111, 99, 0.18);
  background: rgba(246, 255, 252, 0.94);
}

.composer.is-submitting {
  border-color: rgba(217, 121, 65, 0.22);
}

.composer-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
}

.composer-wave-svg {
  position: absolute;
  left: -12%;
  width: 124%;
  height: 100%;
  overflow: visible;
  will-change: transform, opacity;
}

.composer-wave-svg-back {
  bottom: 3px;
  opacity: 0.42;
}

.composer-wave-svg-front {
  bottom: -1px;
  opacity: 0.78;
}

.composer-wave-path {
  fill: none;
  stroke-linecap: round;
}

.composer-wave-path-back {
  stroke: rgba(19, 111, 99, 0.22);
  stroke-width: 9;
}

.composer-wave-path-front {
  stroke: rgba(19, 111, 99, 0.34);
  stroke-width: 6;
}

.composer.is-recording .composer-wave {
  opacity: 1;
}

.composer.is-recording .composer-wave-svg-back {
  animation: waveDriftBack 1.8s linear infinite;
}

.composer.is-recording .composer-wave-svg-front {
  animation: waveDriftFront 1.2s linear infinite;
}

.composer-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.composer-input {
  border: 0;
  background: rgba(255, 255, 255, 0.84);
  border-radius: 18px;
  padding: 16px 18px;
  color: var(--ink);
  min-width: 0;
  outline: none;
  font: 16px/1.2 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}

.composer-input::placeholder {
  color: #7a6f63;
  font-weight: 500;
}

.icon-button {
  position: relative;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button-icon {
  position: relative;
  z-index: 2;
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.voice-button {
  background: rgba(19, 111, 99, 0.1);
  color: var(--link);
  overflow: hidden;
}

.voice-pulse {
  position: absolute;
  inset: 10px;
  border-radius: 16px;
  background: rgba(19, 111, 99, 0.1);
  opacity: 0;
  transform: scale(0.8);
}

.composer.is-recording .voice-pulse {
  opacity: 1;
  animation: voicePulse 1.2s ease-out infinite;
}

.send-button {
  background: var(--ink);
  color: white;
}

.composer-status {
  margin-top: 8px;
  padding: 0 4px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  min-height: 1.2em;
  position: relative;
  z-index: 1;
}

.composer-status:empty {
  display: none;
}

.chart-panel,
.list-panel {
  transition: opacity 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.dashboard.is-focused .list-panel {
  opacity: 1;
}

.dashboard.is-focused .chart-panel {
  box-shadow: 0 28px 80px rgba(76, 57, 29, 0.16);
  border-color: rgba(19, 111, 99, 0.16);
}

.filter-chips,
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
}

.filter-chip {
  border: 1px solid rgba(62, 44, 23, 0.1);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 8px 14px;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  font-weight: 600;
}

.filter-chip.is-active {
  background: var(--link);
  color: white;
  border-color: var(--link);
  box-shadow: 0 12px 28px rgba(19, 111, 99, 0.18);
}

.chart-legend {
  margin-top: 12px;
  gap: 8px 18px;
  color: #5d5448;
  font-size: 0.84rem;
  font-weight: 600;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.chart-shell {
  position: relative;
  min-height: 210px;
  padding: 0;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 248, 240, 0.78)),
    radial-gradient(circle at top left, rgba(19, 111, 99, 0.08), transparent 32%);
  border: 1px solid rgba(62, 44, 23, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.chart {
  width: 100%;
  height: 210px;
  display: block;
  border-radius: 24px;
}

.history-item {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 16px 40px 24px 0;
  border-top: 1px solid rgba(62, 44, 23, 0.08);
}

.history-item:first-child {
  padding-top: 4px;
  border-top: 0;
}

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.history-delete {
  position: absolute;
  top: auto;
  bottom: 8px;
  right: -4px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(32, 28, 23, 0.32);
  cursor: pointer;
  opacity: 0.18;
  transition: opacity 160ms ease, background 160ms ease, color 160ms ease;
}

.history-item:hover .history-delete,
.history-item:focus-within .history-delete {
  opacity: 1;
}

.history-delete:hover,
.history-delete:focus-visible {
  background: rgba(62, 44, 23, 0.08);
  color: rgba(32, 28, 23, 0.7);
  outline: none;
}

.history-delete:disabled {
  cursor: default;
  opacity: 0.2;
}

.history-delete-icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.history-head h2 {
  font-size: 1rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.history-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.history-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(233, 241, 237, 0.78);
  color: var(--chip-ink);
  font-size: 0.8rem;
  font-weight: 600;
}

.metric-chip-main {
  background: rgba(19, 111, 99, 0.12);
  color: var(--link);
}

.history-notes {
  color: #2e2923;
  line-height: 1.45;
}

.empty-state {
  color: var(--muted);
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px dashed rgba(62, 44, 23, 0.12);
}

.hidden {
  display: none !important;
}

@keyframes voicePulse {
  0% {
    opacity: 0.72;
    transform: scale(0.8);
  }

  70% {
    opacity: 0;
    transform: scale(1.22);
  }

  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

@keyframes waveDriftFront {
  0% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(-2.8%);
  }

  100% {
    transform: translateX(0);
  }
}

@keyframes waveDriftBack {
  0% {
    transform: translateX(-1.6%);
  }

  50% {
    transform: translateX(1.4%);
  }

  100% {
    transform: translateX(-1.6%);
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100vw - 20px, 1200px);
    padding-top: 30px;
  }

  .hero {
    padding-top: 0;
  }

  .filter-popover {
    width: min(320px, calc(100vw - 20px));
  }

  .log-panel {
    padding: 18px;
  }

  body {
    padding-bottom: 158px;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .composer-shell {
    bottom: 12px;
    padding: 0 12px;
  }

  .composer {
    border-radius: 22px;
  }

  .composer-main {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .history-head {
    flex-direction: column;
  }

  .section-heading {
    align-items: center;
  }

  .chart-shell {
    min-height: 180px;
  }

  .chart {
    height: 180px;
  }

  .history-item {
    padding: 14px 0;
  }

  .history-delete {
    right: -2px;
  }
}
