/* 2026 interface refresh: warmer, clearer and more expressive without changing app logic. */
:root {
  --ink: #173c32;
  --muted: #6a7972;
  --paper: #f7f7f0;
  --line: #dce6df;
  --green: #14785c;
  --green-dark: #0d5f48;
  --mint: #dff4e9;
  --lavender: #eee9ff;
  --peach: #fff0d6;
  --coral: #ed765f;
  --sun: #f7c85d;
  --radius: 22px;
}

body.app-page {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 8% 0%, #e4f5e9 0, transparent 32rem),
    radial-gradient(circle at 92% 8%, #f1eaff 0, transparent 28rem),
    var(--paper);
}

.app-page header {
  position: sticky;
  top: 0;
  z-index: 8;
  width: min(1120px, calc(100% - 32px));
  height: 76px;
  margin: 10px auto 0;
  padding: 0 18px;
  border: 1px solid #ffffffb8;
  border-radius: 22px;
  background: #ffffffd9;
  box-shadow: 0 14px 40px #1d443514;
  backdrop-filter: blur(18px) saturate(140%);
}

.app-page .brand i {
  position: relative;
  border-color: var(--green);
  background: #fff;
  box-shadow: 8px 0 0 -1px #f4c858, 0 7px 18px #19775a22;
}

.app-page .brand-tagline {
  max-width: none;
  font-size: 14px;
  color: var(--ink);
}

.app-page .city {
  color: var(--green-dark);
  font-weight: 700;
}

.app-page .help {
  border-color: #d8e5dd;
  background: #f7fbf8;
  box-shadow: 0 4px 12px #173f3010;
}

.app-page main {
  max-width: 1120px;
  padding-top: 24px;
}

.feed-intro {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 26px 28px;
  border: 1px solid #ffffffc9;
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 20%, #83c9a8 0 7rem, transparent 7.1rem),
    linear-gradient(130deg, #0f654d, #1c8b68 63%, #5ab88f);
  box-shadow: 0 18px 44px #145b4526;
}

.feed-intro::after {
  content: '';
  position: absolute;
  right: 7%;
  top: -64px;
  width: 190px;
  height: 190px;
  border: 34px solid #ffffff22;
  border-radius: 50%;
  pointer-events: none;
}

.feed-intro > * {
  position: relative;
  z-index: 1;
}

.feed-intro .eyebrow {
  display: inline-flex;
  margin-bottom: 9px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #ffffff20;
  color: #eafff4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.feed-intro h1 {
  max-width: 660px;
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.02;
  letter-spacing: -1.5px;
}

.feed-intro p {
  margin: 12px 0 0;
  color: #e6f7ef;
  font-size: 15px;
}

.feed-intro-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 46px;
  padding: 10px 15px;
  border: 1px solid #ffffff3d;
  border-radius: 14px;
  background: #ffffff18;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.feed-intro-link:hover {
  background: #ffffff2c;
}

.toolbar {
  position: sticky;
  top: 98px;
  z-index: 4;
  gap: 10px;
  padding: 8px;
  border: 1px solid #ffffffc9;
  border-radius: 19px;
  background: #fffffff0;
  box-shadow: 0 10px 28px #173f3012;
  backdrop-filter: blur(16px);
}

.toolbar input {
  min-height: 50px;
  padding-left: 16px;
  border: 0;
  border-radius: 13px;
  background: #f5f8f5;
  box-shadow: inset 0 0 0 1px #e4ebe6;
}

.filter-toggle {
  min-height: 50px;
  border-color: #cfe0d6;
  border-radius: 13px;
  background: var(--mint);
  color: var(--green-dark);
}

.filter-count {
  margin: 2px 2px -2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.grid {
  gap: 18px;
}

.card {
  position: relative;
  border-color: #e3e9e4;
  border-radius: 24px;
  box-shadow: 0 10px 30px #234a3810;
  isolation: isolate;
}

.card .photo {
  background: #e9f0eb;
}

.card .photo img {
  aspect-ratio: 1.08 / 1;
  transition: transform .35s ease, filter .35s ease;
}

.card .content {
  padding: 14px;
}

.card-kind {
  margin-bottom: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: .35px;
  text-transform: uppercase;
}

.card .title {
  color: #17382f;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -.25px;
}

.card .price {
  color: var(--green-dark);
  font-size: 13px;
}

.card-wanted {
  padding: 7px 9px;
  border-radius: 10px;
  background: #f7f4ec;
  color: #405249;
}

.card-wanted span {
  color: #8a6b35;
}

.card .actions {
  gap: 8px;
}

.card .actions .primary,
.primary,
.link-button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #168261, #0f664e);
  box-shadow: 0 7px 16px #116a4f22;
}

.card .actions .card-like {
  border: 1px solid #e3e9e5;
  background: #fff;
}

.card .actions .card-like.liked {
  border-color: #f4c5ca;
  background: #fff0f1;
  color: #c45466;
}

.panel,
.chain-row,
.chain-members article,
.chain-members > div {
  box-shadow: 0 10px 28px #1b45340d;
}

.chain-explainer {
  background: linear-gradient(135deg, #eee9ff, #f8f5ff);
  border-color: #e2dafa;
}

.chain-feed {
  gap: 14px;
}

.chain-feed > h2,
.chain-feed > p,
.chain-feed > .chain-explainer {
  margin-bottom: 0;
}

.chain-card {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 17px;
  overflow: hidden;
  border: 1px solid #dce6df;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 30px #234a3810;
  text-align: left;
}

.chain-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.chain-card-top > span:first-child {
  display: grid;
  gap: 2px;
}

.chain-card-top b {
  color: var(--ink);
  font-size: 15px;
}

.chain-card-top small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.chain-state {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--peach);
  color: #76552f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2px;
}

.chain-map {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 4px 2px 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.chain-node {
  display: grid;
  grid-template-columns: 30px minmax(62px, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  min-width: 125px;
  max-width: 155px;
  padding: 9px;
  border: 1px solid #e1e9e4;
  border-radius: 14px;
  background: linear-gradient(145deg, #f9fbf9, #f2f7f3);
}

.chain-avatar {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
}

.chain-person,
.chain-item {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chain-person {
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.chain-item {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.chain-arrow {
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  color: var(--green);
  font-size: 19px;
  font-weight: 800;
}

.chain-loop {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 50%;
  background: var(--lavender);
  color: #695a97;
}

.chain-close-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 9px;
  padding: 10px 12px;
  border: 1px dashed #c9dbd0;
  border-radius: 13px;
  background: #f5faf7;
}

.chain-close-note b {
  color: var(--green-dark);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.chain-close-note span {
  color: #40544b;
  font-size: 11px;
  font-weight: 600;
}

@media (hover: hover) {
  .chain-card:hover {
    transform: translateY(-2px);
    border-color: #bfd6c8;
    background: #fff;
    box-shadow: 0 16px 38px #173f3018;
  }
}

nav#nav {
  border-color: #ffffffb8;
  background: #fffffff0;
  box-shadow: 0 16px 48px #12382b24;
}

nav#nav .active {
  background: linear-gradient(145deg, #e5f6ec, #d8f1e4);
  color: var(--green-dark);
}

nav#nav .add svg {
  border-radius: 10px;
  background: linear-gradient(135deg, #1b8d69, #0f664e);
  box-shadow: 0 6px 14px #116a4f35;
}

.demo-controls {
  padding: 9px 10px !important;
  border: 1px solid #ffffffbd;
  border-radius: 18px;
  background: #ffffffb8;
  box-shadow: 0 8px 24px #193c2f0d;
  backdrop-filter: blur(14px);
}

dialog {
  border-radius: 28px;
  box-shadow: 0 26px 90px #173b2e38;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-4px);
    border-color: #c6dbcf;
    box-shadow: 0 18px 42px #183f2f1c;
  }

  .card:hover .photo img {
    transform: scale(1.035);
    filter: saturate(1.05);
  }
}

@media (max-width: 700px) {
  .app-page header {
    width: calc(100% - 20px);
    height: 62px;
    margin-top: 8px;
    padding: 0 13px;
    border-radius: 18px;
  }

  .app-page .brand-tagline {
    max-width: 155px;
  }

  .app-page main {
    padding-top: 14px;
  }

  .feed-intro {
    display: block;
    padding: 22px 20px;
    border-radius: 23px;
  }

  .feed-intro h1 {
    max-width: 420px;
    font-size: clamp(27px, 9vw, 38px);
    letter-spacing: -1px;
  }

  .feed-intro p {
    max-width: 360px;
    font-size: 13px;
  }

  .feed-intro-link {
    margin-top: 17px;
  }

  .toolbar {
    top: 80px;
    padding: 6px;
    border-radius: 16px;
  }

  .toolbar input,
  .filter-toggle {
    min-height: 46px;
  }

  .grid {
    gap: 10px;
  }

  .card {
    border-radius: 18px;
  }

  .card .content {
    padding: 10px;
  }

  .card .title {
    font-size: 14px;
  }

  .card-wanted {
    padding: 5px 7px;
  }

  .demo-controls {
    border-radius: 15px;
  }

  .chain-card {
    padding: 14px;
    border-radius: 18px;
  }

  .chain-node {
    min-width: 114px;
  }

  .chain-close-note {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .feed-intro {
    padding: 19px 16px;
  }

  .feed-intro h1 {
    font-size: 26px;
  }

  .feed-intro-link {
    min-height: 42px;
  }

  .card .actions {
    gap: 5px;
  }
}

@media (max-width: 480px) {
  .chain-map {
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    overflow: visible;
  }

  .chain-node {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .chain-arrow {
    align-self: center;
    width: 22px;
    height: 18px;
    flex-basis: 18px;
    transform: rotate(90deg);
  }

  .chain-loop {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card .photo img {
    transform: none !important;
  }
}
