:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #07100f;
  color: #edf7f5;
  --bg: #07100f;
  --panel: rgba(13, 24, 31, 0.92);
  --panel-strong: #101d28;
  --line: rgba(186, 217, 224, 0.14);
  --muted: #8fa3b4;
  --text: #edf7f5;
  --accent: #39d7be;
  --accent-2: #f6c85f;
  --danger: #ff7894;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(57, 215, 190, 0.18), transparent 26rem),
    radial-gradient(circle at 100% 15%, rgba(246, 200, 95, 0.12), transparent 22rem),
    linear-gradient(160deg, #07100f 0%, #0d171c 48%, #111521 100%);
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 18px 16px 96px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0 16px;
}

.eyebrow,
.subline,
h1 {
  margin: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

h1 {
  margin-top: 6px;
  font-size: 36px;
  line-height: 1;
}

.subline {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.signal {
  align-self: flex-start;
  border: 1px solid rgba(57, 215, 190, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--accent);
  font-weight: 900;
  background: rgba(57, 215, 190, 0.08);
}

.quick-grid,
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quick,
.metrics article,
.composer,
.panel,
.search {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.quick {
  min-height: 48px;
  color: #c9d8e5;
  font-weight: 900;
}

.quick.active,
.primary,
.search button {
  border: 0;
  background: var(--accent);
  color: #031514;
}

.composer {
  margin-top: 12px;
  padding: 14px;
}

.composer-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.composer-head span,
.panel-head h2 {
  display: block;
  margin: 0;
  font-weight: 900;
}

.composer-head small,
.panel-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  width: 48px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.icon-button.listening {
  color: #120807;
  background: var(--accent-2);
}

textarea,
input {
  width: 100%;
  border: 1px solid rgba(186, 217, 224, 0.18);
  border-radius: 8px;
  background: #09131b;
  color: var(--text);
  outline: none;
  padding: 13px 14px;
}

textarea:focus,
input:focus {
  border-color: rgba(57, 215, 190, 0.65);
}

.memory-fields {
  display: none;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
}

.memory-fields.show {
  display: grid;
}

.primary {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border-radius: 8px;
  font-weight: 900;
}

.search {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
}

.search button {
  border-radius: 8px;
  font-weight: 900;
}

.metrics {
  margin-top: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metrics article {
  padding: 14px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  color: var(--accent-2);
  font-size: 28px;
}

.view {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.view.active {
  display: grid;
}

.view:not([data-view="home"]) {
  grid-template-columns: 1fr;
}

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

.item {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-top: 1px solid rgba(186, 217, 224, 0.1);
}

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

.item b {
  color: #f7fbff;
}

.meta {
  color: var(--muted);
  font-size: 12px;
}

.item-actions {
  display: flex;
  gap: 8px;
}

.item-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #132233;
  color: #d8e6ef;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
}

.empty {
  color: var(--muted);
  padding: 12px 0;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 10;
  display: grid;
  width: min(520px, calc(100% - 28px));
  transform: translateX(-50%);
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(186, 217, 224, 0.14);
  border-radius: 8px;
  background: rgba(6, 13, 18, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.bottom-nav button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.bottom-nav button.active {
  background: rgba(57, 215, 190, 0.16);
  color: var(--accent);
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px 12px 92px;
  }

  .hero {
    align-items: flex-start;
  }

  h1 {
    font-size: 34px;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view.active,
  .memory-fields {
    grid-template-columns: 1fr;
  }
}
