:root {
  --paper: #f3eedf;
  --paper-deep: #e8dfc7;
  --ink: #16231f;
  --muted: #66726d;
  --line: rgba(22, 35, 31, 0.14);
  --blue: #1656d8;
  --blue-dark: #103c98;
  --tomato: #ef5b3f;
  --acid: #d7ee72;
  --white: #fffdf7;
  --shadow: 0 20px 50px rgba(42, 47, 38, 0.12);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 300px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(215, 238, 114, 0.55), transparent 27rem),
    radial-gradient(circle at 96% 22%, rgba(239, 91, 63, 0.18), transparent 22rem),
    linear-gradient(rgba(22, 35, 31, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 35, 31, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, auto, 22px 22px, 22px 22px, auto;
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.shell {
  width: min(100%, 820px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 18px calc(104px + var(--safe-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 0 16px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 15px 15px 7px 15px;
  color: var(--white);
  background: var(--blue);
  box-shadow: 5px 5px 0 var(--ink);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.62);
  font-weight: 800;
}

.search-panel {
  position: relative;
  overflow: hidden;
  padding: 25px 20px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 26px 26px 10px 26px;
  color: var(--white);
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.1), transparent 42%),
    var(--blue);
  box-shadow: var(--shadow);
}

.search-panel::after {
  position: absolute;
  top: -60px;
  right: -55px;
  width: 170px;
  height: 170px;
  border: 32px solid rgba(215, 238, 114, 0.92);
  border-radius: 44% 56% 63% 37%;
  content: "";
  transform: rotate(19deg);
}

.eyebrow,
.section-kicker {
  margin: 0 0 7px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.search-panel .eyebrow {
  position: relative;
  z-index: 1;
  color: var(--acid);
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 9vw, 58px);
  font-weight: 500;
  line-height: 0.93;
  letter-spacing: -0.055em;
}

h1 em {
  color: var(--acid);
  font-weight: 400;
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.search-form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.search-box {
  display: flex;
  min-width: 0;
  height: 52px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 15px 15px 5px 15px;
  color: var(--ink);
  background: var(--white);
}

.search-box span {
  color: var(--blue);
  font-size: 27px;
  line-height: 1;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.search-box input::placeholder {
  color: #7b8580;
}

.search-submit {
  min-width: 72px;
  border: 0;
  border-radius: 15px 15px 15px 5px;
  color: var(--ink);
  background: var(--acid);
  font-size: 13px;
  font-weight: 900;
}

.quick-row {
  position: relative;
  z-index: 1;
  display: flex;
  overflow-x: auto;
  gap: 7px;
  margin: 13px -20px -2px;
  padding: 0 20px 4px;
  scrollbar-width: none;
}

.quick-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  color: var(--white);
  background: rgba(9, 30, 77, 0.2);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.chip.more {
  color: var(--ink);
  background: var(--white);
}

.active-filter {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  padding: 7px 8px 7px 11px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--acid);
  font-size: 11px;
  font-weight: 800;
}

.active-filter button {
  display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(22, 35, 31, 0.13);
  line-height: 1;
}

main {
  min-height: 400px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 27px 2px 15px;
}

.section-kicker {
  color: var(--tomato);
}

.text-button {
  padding: 8px 11px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.listing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 11px;
}

.listing-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px 18px 7px 18px;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: 0 7px 20px rgba(41, 50, 45, 0.06);
  animation: reveal 0.42s both;
}

.listing-card.has-gallery {
  display: block;
}

.listing-visual {
  position: relative;
  display: flex;
  min-height: 168px;
  align-items: end;
  overflow: hidden;
  padding: 10px 8px;
  color: var(--ink);
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, rgba(255, 255, 255, 0.2) 10px 11px),
    var(--card-color, var(--acid));
}

.listing-visual strong {
  position: relative;
  z-index: 1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 0.9;
}

.listing-card.has-gallery .listing-visual {
  min-height: 230px;
  padding: 0;
}

.listing-gallery {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.listing-gallery::-webkit-scrollbar {
  display: none;
}

.gallery-photo {
  width: 100%;
  min-width: 100%;
  height: 230px;
  flex: 0 0 100%;
  object-fit: cover;
  scroll-snap-align: start;
}

.gallery-photo.is-broken {
  visibility: hidden;
}

.listing-card.has-gallery .listing-symbol {
  display: none;
}

.media-dot,
.photo-count {
  position: absolute;
  z-index: 2;
  top: 9px;
  left: 8px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: 0 2px 8px rgba(22, 35, 31, 0.1);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.photo-count {
  right: 9px;
  left: auto;
}

.listing-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 13px 13px 12px;
}

.listing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.listing-body h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.listing-copy {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 12px;
  color: #53605b;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.listing-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
}

.open-button {
  flex: 1;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px 10px 4px 10px;
  color: var(--white);
  background: var(--ink);
  font-size: 11px;
  font-weight: 850;
}

.favorite-button {
  display: grid;
  width: 35px;
  height: 35px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  font-size: 20px;
}

.favorite-button.active {
  border-color: var(--tomato);
  color: var(--white);
  background: var(--tomato);
}

.status-card,
.saved-empty {
  padding: 24px 20px;
  border: 1px dashed rgba(22, 35, 31, 0.28);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.48);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.load-more {
  width: 100%;
  margin-top: 13px;
  padding: 13px;
  border: 1px solid var(--ink);
  border-radius: 14px 14px 5px 14px;
  background: transparent;
  font-size: 12px;
  font-weight: 850;
}

.saved-list {
  display: grid;
  gap: 10px;
}

.saved-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px 17px 6px 17px;
  background: var(--white);
}

.saved-card button {
  border: 0;
  background: transparent;
}

.saved-main {
  text-align: left;
}

.saved-main strong,
.saved-main small {
  display: block;
}

.saved-main strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.saved-main small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.saved-delete {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line) !important;
  border-radius: 50%;
  color: var(--tomato);
  font-size: 19px;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 10px;
  bottom: calc(8px + var(--safe-bottom));
  left: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(calc(100% - 20px), 780px);
  margin: 0 auto;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 21px 21px 9px 21px;
  background: rgba(22, 35, 31, 0.94);
  box-shadow: 0 14px 38px rgba(22, 35, 31, 0.25);
  backdrop-filter: blur(16px);
}

.nav-item {
  display: grid;
  gap: 2px;
  padding: 7px 2px;
  border: 0;
  border-radius: 14px;
  color: rgba(255, 253, 247, 0.62);
  background: transparent;
}

.nav-item span {
  font-size: 20px;
  line-height: 1;
}

.nav-item small {
  font-size: 9px;
  font-weight: 800;
}

.nav-item.active {
  color: var(--ink);
  background: var(--acid);
}

.catalog-panel {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px 24px 8px 24px;
  background:
    radial-gradient(circle at 95% 0, rgba(215, 238, 114, 0.65), transparent 15rem),
    rgba(255, 253, 247, 0.72);
  box-shadow: var(--shadow);
  animation: reveal 0.35s both;
}

.catalog-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 3px 2px 18px;
  border-bottom: 1px solid var(--line);
}

.catalog-intro .eyebrow {
  color: var(--tomato);
}

.catalog-intro > span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.category-list {
  display: grid;
  gap: 10px;
  padding: 16px 0 2px;
}

.category-group {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px 17px 6px 17px;
  background: rgba(255, 253, 247, 0.86);
  animation: reveal 0.38s both;
}

.category-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 10px;
}

.category-title > span {
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
}

.category-group h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.category-buttons button {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 11px;
}

.category-buttons .all-category {
  color: var(--white);
  background: var(--blue);
}

.toast {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: calc(92px + var(--safe-bottom));
  left: 20px;
  width: fit-content;
  max-width: calc(100% - 40px);
  margin: auto;
  padding: 11px 15px;
  border-radius: 999px;
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 620px) {
  .shell {
    padding-right: 28px;
    padding-left: 28px;
  }

  .search-panel {
    padding: 34px 34px 25px;
  }

  .quick-row {
    margin-right: -34px;
    margin-left: -34px;
    padding-right: 34px;
    padding-left: 34px;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
