@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --green: #61b94f;
  --green-dark: #34863b;
  --yellow: #f4c94c;
  --page: #dfe4da;
  --bg: #f4f5f2;
  --card: #ffffff;
  --secondary: #edf1ea;
  --tertiary: #eef0eb;
  --text: #172018;
  --text-secondary: #555c55;
  --muted: #70766f;
  --line: #e4e7df;
  --on-accent: #ffffff;
  --accent-soft: #e2f5de;
  --favorite: #e94f64;
  --error: #b42318;
  --field-placeholder: #8a9288;
  --hero-gradient: linear-gradient(135deg, #dcf4d7, #fff3be);
  --card-glass: rgba(255, 255, 255, .92);
  --tabbar: rgba(255, 255, 255, .94);
  --sheet: rgba(255, 255, 255, .92);
  --backdrop: rgba(16, 20, 16, .45);
  --map-grid: rgba(255,255,255,.55);
  --map-bg: linear-gradient(135deg, #cfddd0, #edf1d8);
  --handle: #c9cec5;
  --shell-shadow: 0 24px 80px rgba(0, 0, 0, .18);
  --dialog-shadow: 0 24px 90px rgba(0, 0, 0, .25);
  --pin-shadow: 0 8px 20px rgba(0, 0, 0, .18);
  --shadow: 0 14px 34px rgba(20, 32, 20, .09);
}

:root[data-theme="dark"] {
  --green: #f59e0b;
  --green-dark: #fbbf24;
  --yellow: #fbbf24;
  --page: #0b1120;
  --bg: #111827;
  --card: #1f2937;
  --secondary: #374151;
  --tertiary: #2b3544;
  --text: #f9fafb;
  --text-secondary: #d1d5db;
  --muted: #9ca3af;
  --line: #374151;
  --on-accent: #111827;
  --accent-soft: rgba(245, 158, 11, .16);
  --favorite: #fb7185;
  --error: #fca5a5;
  --field-placeholder: #cbd5e1;
  --hero-gradient: linear-gradient(135deg, #1f2937, #3f3a24);
  --card-glass: rgba(31, 41, 55, .94);
  --tabbar: rgba(17, 24, 39, .96);
  --sheet: rgba(31, 41, 55, .95);
  --backdrop: rgba(3, 7, 18, .70);
  --map-grid: rgba(156, 163, 175, .18);
  --map-bg: linear-gradient(135deg, #111827, #1f2937);
  --handle: #4b5563;
  --shell-shadow: 0 24px 80px rgba(0, 0, 0, .45);
  --dialog-shadow: 0 24px 90px rgba(0, 0, 0, .55);
  --pin-shadow: 0 8px 20px rgba(0, 0, 0, .30);
  --shadow: 0 18px 38px rgba(0, 0, 0, .28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]),
  :root[data-theme="system"] {
    --green: #f59e0b;
    --green-dark: #fbbf24;
    --yellow: #fbbf24;
    --page: #0b1120;
    --bg: #111827;
    --card: #1f2937;
    --secondary: #374151;
    --tertiary: #2b3544;
    --text: #f9fafb;
    --text-secondary: #d1d5db;
    --muted: #9ca3af;
    --line: #374151;
    --on-accent: #111827;
    --accent-soft: rgba(245, 158, 11, .16);
    --favorite: #fb7185;
    --error: #fca5a5;
    --field-placeholder: #cbd5e1;
    --hero-gradient: linear-gradient(135deg, #1f2937, #3f3a24);
    --card-glass: rgba(31, 41, 55, .94);
    --tabbar: rgba(17, 24, 39, .96);
    --sheet: rgba(31, 41, 55, .95);
    --backdrop: rgba(3, 7, 18, .70);
    --map-grid: rgba(156, 163, 175, .18);
    --map-bg: linear-gradient(135deg, #111827, #1f2937);
    --handle: #4b5563;
    --shell-shadow: 0 24px 80px rgba(0, 0, 0, .45);
    --dialog-shadow: 0 24px 90px rgba(0, 0, 0, .55);
    --pin-shadow: 0 8px 20px rgba(0, 0, 0, .30);
    --shadow: 0 18px 38px rgba(0, 0, 0, .28);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: grid;
  place-items: center;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.phone {
  width: min(430px, 100vw);
  height: min(920px, 100vh);
  background: var(--bg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shell-shadow);
}

.screen {
  display: none;
  height: 100%;
}

.screen-active {
  display: block;
}

#app {
  padding: 18px 16px 104px;
  overflow-y: auto;
}

#onboarding {
  padding: 28px 20px;
  overflow-y: auto;
}

.onboarding-hero {
  margin: 18px 0 28px;
}

.app-icon {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: var(--green);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 800;
  margin-bottom: 18px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: 36px;
  line-height: 1.03;
  letter-spacing: 0;
  margin-bottom: 12px;
}

.onboarding-hero p,
.activity-card p,
.recommendation p,
small {
  color: var(--muted);
}

.field-label {
  display: block;
  margin: 18px 0 8px;
  font-weight: 750;
}

.text-input,
.search,
select {
  width: 100%;
  border: 0;
  outline: none;
  background: var(--card);
  border-radius: 16px;
  min-height: 48px;
  padding: 0 14px;
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: var(--field-placeholder);
}

.stepper {
  background: var(--card);
  border-radius: 18px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stepper button,
.icon-button,
.profile-dot {
  border: 0;
  background: var(--secondary);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-weight: 800;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 17px;
  font-weight: 800;
  margin-top: 12px;
}

.primary-button {
  background: var(--green);
  color: var(--on-accent);
}

.secondary-button {
  background: var(--secondary);
  color: var(--text);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: .58;
  cursor: not-allowed;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.topbar h2 {
  font-size: 24px;
  line-height: 1.1;
}

.location-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  padding: 6px 0 0;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 10px;
  margin-bottom: 14px;
}

.rail,
.card-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar,
.card-rail::-webkit-scrollbar {
  display: none;
}

.chip,
.radius {
  border: 0;
  background: var(--card);
  color: var(--text);
  padding: 0 14px;
  min-height: 42px;
  border-radius: 15px;
  font-weight: 800;
  white-space: nowrap;
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.chip.active,
.radius.active {
  background: var(--green);
  color: var(--on-accent);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.catalog-section {
  margin: 14px 0 22px;
}

.catalog-section h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.activity-card {
  min-width: 238px;
  max-width: 238px;
  position: relative;
  background: var(--card);
  border-radius: 22px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.compact-card {
  max-width: none;
  min-width: 100%;
}

.thumb {
  height: 102px;
  border-radius: 18px;
  background: var(--hero-gradient);
  display: grid;
  place-items: center;
  font-size: 42px;
  margin-bottom: 12px;
}

.favorite {
  position: absolute;
  right: 20px;
  top: 20px;
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--card-glass);
  color: var(--muted);
  z-index: 2;
}

.favorite.active {
  color: var(--favorite);
}

.meta-line,
.card-footer,
.badges,
.mini-tags {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.meta-line strong {
  color: var(--green-dark);
  font-size: 12px;
}

.meta-line em {
  font-style: normal;
  color: var(--muted);
  background: var(--tertiary);
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.activity-card h4 {
  font-size: 17px;
  line-height: 1.18;
  margin: 6px 0;
}

.activity-card p {
  font-size: 13px;
  line-height: 1.32;
  min-height: 34px;
}

.badges {
  margin: 10px 0;
}

.badges span,
.mini-tags span {
  background: var(--tertiary);
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badges .price {
  color: var(--green-dark);
  background: var(--accent-soft);
}

.card-footer {
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mini-tags {
  margin-top: 10px;
}

.view {
  display: none;
}

.view-active {
  display: block;
}

.view-title {
  margin: 4px 0 16px;
}

.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 74px;
  background: var(--tabbar);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  z-index: 20;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  font-weight: 800;
  font-size: 18px;
}

.tab span {
  font-size: 10px;
}

.tab.active {
  color: var(--green-dark);
}

.dialog {
  width: min(430px, calc(100vw - 24px));
  max-height: min(860px, calc(100vh - 24px));
  border: 0;
  border-radius: 26px;
  padding: 0;
  background: var(--bg);
  box-shadow: var(--dialog-shadow);
}

.dialog::backdrop {
  background: var(--backdrop);
}

#detailContent,
.filter-panel {
  padding: 16px;
}

.dialog-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  background: var(--card-glass);
  color: var(--text);
  font-size: 24px;
}

.detail-hero {
  height: 214px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: var(--hero-gradient);
  font-size: 82px;
}

.detail-title,
.detail-grid,
.why,
.panel,
.profile-card {
  background: var(--card);
  border-radius: 20px;
  padding: 16px;
  margin-top: 14px;
}

.detail-title small {
  color: var(--green-dark);
  font-weight: 800;
}

.detail-actions {
  margin-top: 4px;
}

.detail-grid {
  display: grid;
  gap: 12px;
}

.detail-grid div,
.profile-card div {
  display: grid;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-grid div:last-child,
.profile-card div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-grid span,
.profile-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.map-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.radius {
  flex: 1;
  justify-content: center;
  padding: 0;
  min-height: 38px;
  font-size: 12px;
}

.map-warning {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: -2px 0 10px;
}

.map-canvas {
  height: 430px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, var(--map-grid) 1px, transparent 1px),
    linear-gradient(var(--map-grid) 1px, transparent 1px),
    var(--map-bg);
  background-size: 54px 54px, 54px 54px, auto;
}

.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 3px solid var(--card);
  border-radius: 18px 18px 18px 4px;
  width: 42px;
  height: 42px;
  background: var(--green);
  box-shadow: var(--pin-shadow);
}

.pin.promoted {
  background: var(--yellow);
}

.sheet {
  margin-top: -110px;
  position: relative;
  background: var(--sheet);
  border-radius: 24px 24px 0 0;
  padding: 14px 14px 96px;
  backdrop-filter: blur(18px);
}

.sheet-handle {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: var(--handle);
  margin: 0 auto 12px;
}

.compact-list,
.vertical-list {
  display: grid;
  gap: 12px;
}

.empty {
  text-align: center;
  background: var(--card);
  border-radius: 22px;
  padding: 38px 22px;
  color: var(--text);
  font-weight: 850;
}

.recommendation {
  margin-top: 14px;
}

.recommendation p {
  background: var(--card);
  border-radius: 0 0 18px 18px;
  padding: 2px 14px 14px;
  margin-top: -6px;
  font-size: 13px;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 16px 0;
  font-weight: 750;
}

.address-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  max-height: 280px;
  overflow: auto;
}

.address-option {
  border: 0;
  text-align: left;
  background: var(--card);
  border-radius: 14px;
  min-height: 44px;
  padding: 0 12px;
  font-weight: 750;
}

.textarea {
  min-height: 96px;
  padding-top: 12px;
  resize: vertical;
}

.provider-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.provider-stat {
  background: var(--tertiary);
  border-radius: 16px;
  padding: 10px;
}

.provider-stat strong {
  display: block;
  font-size: 20px;
}

.provider-stat span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.plan-list,
.admin-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.plan-card {
  border: 1px solid var(--line);
  background: var(--secondary);
  border-radius: 16px;
  padding: 12px;
}

.plan-card.active {
  border-color: var(--green);
  background: var(--accent-soft);
}

.plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.plan-head strong {
  font-size: 18px;
}

.plan-head span,
.plan-card p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

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

.admin-item {
  background: var(--tertiary);
  border-radius: 16px;
  padding: 10px;
}

.admin-item strong,
.admin-item span {
  display: block;
}

.admin-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  margin-top: 3px;
}

.provider-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.provider-item {
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  border: 1px solid var(--line);
}

.provider-message {
  width: 100%;
  text-align: left;
  font: inherit;
}

.provider-item h4 {
  margin-bottom: 6px;
}

.status-pill {
  display: inline-flex;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 850;
}

.validation {
  color: var(--error);
  font-size: 13px;
  font-weight: 750;
  min-height: 18px;
  margin-top: 10px;
}

.chat-header {
  background: var(--card);
  border-radius: 20px;
  padding: 16px;
  margin: 16px 16px 0;
}

.chat-header small {
  color: var(--green-dark);
  font-weight: 850;
}

.chat-list {
  display: grid;
  gap: 10px;
  max-height: min(520px, calc(100vh - 260px));
  overflow: auto;
  padding: 16px;
}

.chat-message {
  justify-self: start;
  max-width: 82%;
}

.chat-message.mine {
  justify-self: end;
}

.chat-message p {
  background: var(--card);
  border-radius: 18px;
  padding: 10px 12px;
  line-height: 1.35;
}

.chat-message.mine p {
  background: var(--green);
  color: var(--on-accent);
}

.chat-message span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 10px;
  padding: 0 16px 16px;
}

.chat-form .primary-button {
  margin-top: 0;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.load-error {
  padding: 20px;
  color: var(--error);
}

.theme-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: var(--secondary);
  margin-top: 12px;
}

.theme-option {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.theme-option.active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}

@media (max-width: 460px) {
  body {
    display: block;
    background: var(--bg);
  }

  .phone {
    width: 100vw;
    height: 100vh;
    box-shadow: none;
  }
}
