:root {
  color-scheme: light;
  --ink: #141916;
  --muted: #727a74;
  --line: #e6ebe7;
  --paper: #f7faf6;
  --panel: #ffffff;
  --green: #67c843;
  --green-mid: #4f9f34;
  --green-deep: #31563b;
  --green-dark: #1c3c28;
  --cream: #f2f1eb;
  --amber: #b9752a;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--green-dark);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--green-dark);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  max-width: 520px;
  margin: 0 auto;
  background: var(--green);
  position: relative;
  overflow-x: hidden;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.28);
}

.view {
  display: none;
  min-height: calc(100vh - 92px);
}

.view.active {
  display: block;
}

.hero {
  min-height: 54vh;
  padding: calc(18px + env(safe-area-inset-top)) 28px 36px;
  color: white;
  background:
    radial-gradient(circle at 80% 46%, rgba(242, 255, 228, 0.9) 0 12%, rgba(242, 255, 228, 0.42) 20%, rgba(103, 200, 67, 0) 40%),
    linear-gradient(180deg, #69c944 0%, #66c641 54%, #20920f 100%);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  left: -22%;
  right: -18%;
  bottom: -70px;
  height: 190px;
  background:
    radial-gradient(ellipse at 22% 75%, #167807 0 32%, transparent 33%),
    radial-gradient(ellipse at 58% 68%, #27a814 0 36%, transparent 37%),
    radial-gradient(ellipse at 88% 76%, #75cf4f 0 30%, transparent 31%);
  opacity: 0.9;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 34px;
  opacity: 0.92;
}

.phone-icons {
  word-spacing: 8px;
}

.hero-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 26px;
}

.install-pill, .profile-button {
  min-height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: white;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  font-weight: 850;
}

.install-pill {
  padding: 0 20px;
}

.profile-button {
  width: 46px;
  font-size: 1.35rem;
}

.eyebrow {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

h1, h2, p {
  margin: 0;
}

.hero h1 {
  max-width: 390px;
  font-size: clamp(2.25rem, 11vw, 4rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 310px;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.35;
  font-size: 1.02rem;
  font-weight: 700;
}

.hero-card {
  width: min(78%, 320px);
  margin-top: 28px;
  padding: 16px 18px;
  border-radius: 26px;
  background: rgba(40, 107, 32, 0.26);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 1;
}

.hero-card span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
}

.hero-card strong {
  display: block;
  margin-top: 5px;
  font-size: 1rem;
}

.signal-chart {
  position: absolute;
  right: 28px;
  bottom: 28px;
  z-index: 1;
  height: 112px;
  width: 124px;
  display: flex;
  align-items: end;
  gap: 7px;
}

.signal-chart span {
  flex: 1;
  min-width: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.11);
}

.bottom-sheet {
  margin-top: -24px;
  padding: 28px 22px 24px;
  min-height: 46vh;
  border-radius: 38px 38px 0 0;
  background: var(--panel);
  position: relative;
  z-index: 2;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.metric {
  min-width: 104px;
  padding: 13px 14px;
  border-radius: 999px;
  background: var(--cream);
  white-space: nowrap;
}

.metric span {
  display: block;
  color: #4f6f55;
  font-size: 0.72rem;
  font-weight: 850;
}

.metric strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.03rem;
  font-weight: 900;
}

.query-form, .admin-form {
  display: grid;
  gap: 14px;
}

.sheet-title {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 2px;
}

.sheet-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #111;
  color: white;
}

.sheet-title h2 {
  font-size: 1.34rem;
  font-weight: 900;
}

.sheet-title p {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.3;
  font-size: 0.9rem;
}

textarea, input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px 16px;
  background: #fbfcfb;
  color: var(--ink);
  outline: none;
}

textarea:focus, input:focus, select:focus {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 4px rgba(103, 200, 67, 0.18);
}

textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.form-row button, .admin-form button {
  border-radius: 22px;
  padding: 0 20px;
  background: #111;
  color: white;
  font-weight: 900;
}

.admin-form button {
  min-height: 52px;
}

.answer {
  min-height: 128px;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fbfcfb;
  white-space: pre-wrap;
  line-height: 1.55;
  color: #263129;
}

.compact-header {
  padding: calc(32px + env(safe-area-inset-top)) 28px 46px;
  color: white;
  background: var(--green-deep);
}

.compact-header h1 {
  font-size: clamp(2.2rem, 11vw, 3.8rem);
  line-height: 1.04;
  font-weight: 900;
}

.source-sheet {
  min-height: calc(100vh - 210px);
}

.archive-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  margin-bottom: 14px;
  border-radius: 24px;
  background: var(--cream);
}

.archive-panel span {
  display: block;
  color: #4f6f55;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.archive-panel strong {
  display: block;
  margin-top: 5px;
  font-size: 0.96rem;
  line-height: 1.25;
}

.archive-panel button {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 15px;
  background: #111;
  color: white;
  font-weight: 900;
  white-space: nowrap;
}

.archive-panel button:disabled {
  opacity: 0.6;
}

.source-list {
  display: grid;
  gap: 12px;
}

.source-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fbfcfb;
}

.source-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.source-item strong {
  display: block;
  line-height: 1.25;
}

.source-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(100%, 520px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  z-index: 10;
}

.nav-button {
  min-height: 58px;
  border-radius: 18px;
  background: transparent;
  color: #9da39f;
  font-size: 0.78rem;
  font-weight: 850;
}

.nav-button span {
  display: block;
  margin-bottom: 2px;
  color: currentColor;
  font-size: 1.45rem;
  line-height: 1;
}

.nav-button.active {
  color: #111;
  background: var(--cream);
}

.hidden {
  display: none;
}

@media (min-width: 760px) {
  body {
    padding: 26px;
  }

  .app-shell {
    min-height: calc(100vh - 52px);
    border-radius: 34px;
    overflow: hidden;
  }

  .bottom-nav {
    bottom: 26px;
    border-radius: 0 0 34px 34px;
  }
}

@media (max-width: 380px) {
  .hero {
    padding-left: 22px;
    padding-right: 22px;
  }

  .bottom-sheet {
    padding-left: 16px;
    padding-right: 16px;
  }

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