:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f5f6f4;
  --surface-strong: #ecefeb;
  --text: #20231f;
  --muted: #686d67;
  --border: #dfe4dc;
  --green: #1f8a55;
  --green-soft: #e4f4e9;
  --amber: #b86d12;
  --amber-soft: #fff1dc;
  --red: #b73737;
  --red-soft: #ffe9e7;
  --shadow: 0 18px 45px rgba(36, 43, 33, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

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

button {
  border: 0;
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

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

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.env-pill {
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.env-pill.ready {
  border-color: rgba(31, 138, 85, 0.35);
  background: var(--green-soft);
  color: var(--green);
}

.primary,
.ghost,
.status-actions button,
.quick-replies button,
.mobile-nav button,
.segmented button,
.danger-button {
  min-height: 38px;
  border-radius: var(--radius-sm);
  padding: 0 13px;
  font-size: 13px;
  font-weight: 700;
}

.primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: white;
}

.ghost {
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
  padding: 18px 22px 88px;
}

.filters,
.detail {
  position: sticky;
  top: 86px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.filters {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.filter-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--green);
  text-transform: uppercase;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius);
  background: var(--surface);
}

.segmented button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: white;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(26, 30, 25, 0.08);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

select,
input,
textarea {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: white;
  color: var(--text);
}

textarea {
  resize: vertical;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--green);
}

.check {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px;
  color: var(--text);
}

.check input {
  width: 17px;
  height: 17px;
  min-height: auto;
  accent-color: var(--green);
}

.notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--green-soft);
  color: #27533a;
}

.notice p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.pickup-points {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.pickup-points strong {
  font-size: 12px;
}

.pickup-points span {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

.main-column {
  min-width: 0;
}

.feed {
  display: grid;
  gap: 16px;
}

.feed-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  min-height: 112px;
  padding: 4px 2px 12px;
}

.feed-head h1 {
  margin: 0;
  max-width: 640px;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 0.96;
  letter-spacing: 0;
}

.feed-head p {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.metric {
  min-width: 128px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric strong,
.metric span {
  display: block;
}

.metric strong {
  color: var(--green);
  font-size: 28px;
  line-height: 1;
}

.metric span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

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

.listing {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  min-height: 146px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.listing:hover,
.listing.selected {
  border-color: rgba(31, 138, 85, 0.55);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.thumb {
  min-width: 0;
}

.thumb svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  stroke-width: 1;
}

.listing-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.listing-top {
  display: grid;
  gap: 8px;
}

.listing h2,
.detail-title h2,
.compliance h2,
.chat h3,
.modal h2 {
  margin: 0;
  letter-spacing: 0;
}

.listing h2 {
  font-size: 17px;
  line-height: 1.18;
}

.listing p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.free-price {
  color: var(--green);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tag.free {
  background: var(--green-soft);
  color: var(--green);
}

.tag.urgent {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.today {
  background: #ecf4ff;
  color: #2c5f90;
}

.tag.reserved {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.gone {
  background: var(--surface-strong);
  color: var(--muted);
}

.map-view {
  min-height: 620px;
}

.map-status {
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.map-canvas {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(32, 35, 31, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(32, 35, 31, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 25% 35%, rgba(31, 138, 85, 0.13), transparent 24%),
    radial-gradient(circle at 70% 58%, rgba(184, 109, 18, 0.13), transparent 22%),
    var(--surface);
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
}

.map-canvas::before {
  content: "Berlin Kiez discovery - approximate points";
  position: absolute;
  top: 18px;
  left: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.map-pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  gap: 2px;
  min-width: 112px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(31, 138, 85, 0.35);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: white;
  color: var(--green);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 850;
}

.map-pin span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.map-pin.selected {
  background: var(--green);
  color: white;
}

.map-pin.selected span {
  color: rgba(255, 255, 255, 0.78);
}

.detail {
  overflow: hidden;
}

.detail-hero {
  position: relative;
  padding: 12px;
  background: var(--surface);
}

.detail-hero .thumb svg {
  max-height: 240px;
  object-fit: cover;
}

.icon-button {
  position: absolute;
  right: 22px;
  top: 22px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: white;
  color: var(--red);
  box-shadow: 0 8px 26px rgba(32, 35, 31, 0.16);
}

.detail-title,
.facts,
.chat,
.detail .notice,
.status-actions {
  margin: 16px;
}

.detail-title {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
}

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

.detail-title p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.facts {
  display: grid;
  gap: 8px;
}

.facts div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.facts dd {
  margin: 0;
  font-size: 13px;
}

.status-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.status-actions button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.chat {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.section-head h3 {
  font-size: 16px;
}

.section-head span {
  color: var(--muted);
  font-size: 12px;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-replies button {
  min-height: 32px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.messages {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.messages p {
  display: grid;
  gap: 4px;
  width: fit-content;
  max-width: 86%;
  margin: 0;
  border-radius: var(--radius);
  padding: 9px 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.messages p.mine {
  justify-self: end;
  background: var(--green);
  color: white;
}

.messages strong {
  font-size: 11px;
}

.message-box {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
}

.message-box button {
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: white;
}

.safety {
  background: var(--amber-soft);
  color: #69450f;
}

.compliance {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.compliance h2 {
  font-size: 22px;
}

.compliance p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.compliance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.compliance-grid button {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: white;
  color: var(--text);
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.helper-text,
.form-error {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.helper-text {
  color: var(--muted);
}

.form-error {
  border: 1px solid rgba(183, 55, 55, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 750;
}

.mobile-nav {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 27, 21, 0.34);
}

.modal {
  display: grid;
  gap: 16px;
  width: min(760px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  border-radius: var(--radius);
  padding: 22px;
  background: white;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
}

.modal h2 {
  font-size: 26px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wide {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.report {
  max-width: 460px;
}

.auth {
  max-width: 480px;
}

.report p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.report label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 14px;
}

.danger-button {
  background: var(--red);
  color: white;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .detail {
    position: static;
    grid-column: 1 / -1;
  }

  .detail-hero .thumb svg {
    max-height: 180px;
  }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .search {
    grid-column: 1 / -1;
    order: 3;
  }

  .app-shell {
    display: block;
    padding: 14px 14px 92px;
  }

  .filters {
    position: static;
    margin-bottom: 16px;
  }

  .listing-grid {
    grid-template-columns: 1fr;
  }

  .feed-head {
    align-items: start;
  }

  .metric {
    display: none;
  }

  .detail {
    margin-top: 16px;
  }

  .compliance {
    grid-template-columns: 1fr;
  }

  .mobile-nav {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
  }

  .mobile-nav button {
    min-height: 42px;
    background: transparent;
    color: var(--muted);
  }

  .mobile-nav button.active {
    background: var(--green);
    color: white;
  }
}

@media (max-width: 560px) {
  .brand span {
    display: none;
  }

  .top-actions {
    gap: 6px;
  }

  .env-pill {
    display: none;
  }

  .primary {
    padding: 0 10px;
  }

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

  .feed-head h1 {
    font-size: 34px;
  }

  .detail-title,
  .facts div,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .compliance-grid {
    grid-template-columns: 1fr;
  }
}
