:root {
  --accent: #e86f5a;
  --accent-dark: #d45842;
  --accent-soft: #fdf0ed;
  --bg: #faf9f7;
  --card: #ffffff;
  --text: #1c1917;
  --muted: #78716c;
  --line: #ece8e4;
  --shadow: 0 2px 12px rgba(28, 25, 23, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(circle at top right, rgba(232, 111, 90, 0.07), transparent 42%),
    var(--bg);
}

.hidden { display: none !important; }

.icon {
  width: 18px;
  height: 18px;
  display: block;
}

.app {
  max-width: 420px;
  margin: 0 auto;
  padding: 8px 12px 76px;
}

.hero {
  text-align: center;
  padding: 4px 0 14px;
}

.hero__badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.hero__badge.is-premium {
  background: linear-gradient(135deg, #fde8b8, #f5c76a);
  color: #7a5200;
}

.hero__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero__subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.card--flat {
  box-shadow: none;
  background: transparent;
  border: none;
  padding: 0 2px 4px;
}

.card--accent {
  background: linear-gradient(135deg, #fffaf8 0%, #fdf0ed 100%);
  border-color: rgba(232, 111, 90, 0.12);
}

.card--stat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.card__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.card__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.card__icon .icon {
  width: 16px;
  height: 16px;
}

.card__icon--accent {
  background: rgba(255, 255, 255, 0.75);
}

.card__title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.card__text, .card__muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.card__hint {
  color: var(--muted);
  font-size: 11px;
  margin: -2px 0 8px;
}

.stat { text-align: center; }

.stat__value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: -0.02em;
}

.stat__label {
  color: var(--muted);
  font-size: 11px;
}

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

.row-between--top {
  align-items: flex-start;
}

.card__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.icon-btn .icon {
  width: 16px;
  height: 16px;
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn--accent {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(232, 111, 90, 0.2);
  color: var(--accent-dark);
}

.icon-btn--feed {
  align-self: center;
}

.switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch__slider {
  position: absolute;
  inset: 0;
  background: #e7e2de;
  border-radius: 999px;
  transition: 0.2s;
}

.switch__slider:before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.switch input:checked + .switch__slider {
  background: var(--accent);
}

.switch input:checked + .switch__slider:before {
  transform: translateX(18px);
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:active { opacity: 0.85; }

.btn--primary {
  background: var(--accent);
  color: white;
}

.btn--block { width: 100%; }

.select, input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-family: var(--font);
  font-size: 13px;
  background: #fff;
  color: var(--text);
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.range-row label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chips--wrap { flex-wrap: wrap; overflow: visible; }

.chip {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.chip--active {
  background: var(--accent-soft);
  border-color: rgba(232, 111, 90, 0.35);
  color: var(--accent-dark);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  font-weight: 500;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.panel { display: none; }
.panel--active { display: block; }

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: calc(100% - 20px);
  max-width: 400px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 5px;
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.08);
}

.tab {
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 6px 2px;
  font-family: var(--font);
  cursor: pointer;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tab__icon .icon {
  width: 17px;
  height: 17px;
}

.tab__label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tab--active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.feed-list { display: grid; gap: 8px; }

.feed-item {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  background: white;
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.feed-item__photo {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--accent-soft);
  align-self: center;
}

.feed-item__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feed-item__photo--empty {
  display: grid;
  place-items: center;
  color: var(--accent-dark);
  opacity: 0.45;
}

.feed-item__photo--empty .icon {
  width: 20px;
  height: 20px;
}

.feed-item__body {
  flex: 1;
  min-width: 0;
}

.feed-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.feed-item__source {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.feed-item__price {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.feed-item__meta {
  display: grid;
  gap: 5px;
  margin-bottom: 6px;
}

.feed-meta {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}

.feed-meta__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: grid;
  place-items: center;
}

.feed-meta__icon .icon {
  width: 12px;
  height: 12px;
}

.feed-meta__text {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text);
  padding-top: 3px;
}

.feed-item__desc {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-empty {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px 12px;
}

.loader {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.loader__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  background: rgba(28, 25, 23, 0.9);
  color: white;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  z-index: 100;
}

.gate {
  max-width: 300px;
  text-align: center;
  padding: 8px;
}

.gate__logo {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: grid;
  place-items: center;
}

.gate__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.gate__text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 16px;
}

.gate__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  border: none;
  cursor: pointer;
}

.gate__btn .icon {
  width: 15px;
  height: 15px;
}
