/* Rimoly premium web layer: anthracite surfaces, vivid Rimoly red for primary
   and active states, lightly rounded cards and buttons. Loaded after all
   inline/legacy styles; only presentation, no behaviour. */
:root {
  --red: #E30613;
  --red-deep: #b0050f;
  --rp-font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --rp-touch: 44px;
  --rp-radius: 12px;
  --rp-radius-sm: 9px;
  --rp-ease: cubic-bezier(.2, .7, .2, 1);
}
/* Keep dialog headers readable and fixed while only their contents scroll. */
body.dark .modal-header { background: var(--rp-card); color: var(--ink); }
body.dark .modal-header h2 { color: var(--ink); }
#category-filter-overlay .modal { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
#category-filter-overlay .modal-header { flex-shrink: 0; }
#category-filter-overlay .modal-body { overflow-y: auto; min-height: 0; }
body:not(.dark) {
  --paper: #f4f4f5;
  --ink: #17181a;
  --muted: #5d636a;
  --line: #dcdee2;
  --rp-card: #fbfbfc;
  --rp-raise: #ebecee;
  background: var(--paper);
}
body.dark {
  --paper: #0B0B0D;
  --ink: #FFFFFF;
  --muted: #A0A0A6;
  --line: #303035;
  --rp-card: #1F1F23;
  --rp-raise: #303035;
  background: var(--paper);
  color: var(--ink);
}

/* ---------- Top bar: anthracite instead of a red slab ---------- */
nav:not(.bottom-nav) {
  background: #17181a;
  box-shadow: 0 1px 0 #ffffff12;
}
body:not(.dark) nav:not(.bottom-nav) { background: #1d1f22; }
nav:not(.bottom-nav) .nav-btn-solid { background: var(--red); color: #fff; border-radius: var(--rp-radius-sm); }
nav:not(.bottom-nav) .nav-btn-solid:hover { background: var(--red-deep); }
nav:not(.bottom-nav) .nav-btn-outline { border-color: #ffffff40; border-radius: var(--rp-radius-sm); }

/* ---------- Home category tiles ---------- */
.rp-tiles { max-width: 1200px; margin: 1rem auto .25rem; padding: 0 1.25rem; }
.rp-tiles-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.rp-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem;
  min-height: 96px; padding: .8rem .4rem; border: 1px solid var(--line); border-radius: var(--rp-radius);
  background: var(--rp-card); color: var(--ink); font: 750 .92rem 'DM Sans', sans-serif; cursor: pointer;
  transition: background-color .18s var(--rp-ease), border-color .18s var(--rp-ease), transform .18s var(--rp-ease);
  -webkit-tap-highlight-color: transparent;
}
.rp-tile svg { width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rp-tile { min-height: 112px; border-radius: 14px; }
body.dark .rp-tile:not(.active) { background: #141417; border-color: #2a2a2f; }
.rp-tile.active { box-shadow: 0 6px 18px color-mix(in srgb, var(--red) 35%, transparent); }
.rp-tile:hover { border-color: color-mix(in srgb, var(--red) 60%, var(--line)); }
.rp-tile:active { transform: scale(.98); }
.rp-tile.is-active, .rp-tile[aria-expanded="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.rp-subcats { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .6rem; }
.rp-subcats[hidden] { display: none; }
.rp-subcats a {
  display: inline-flex; align-items: center; min-height: 40px; padding: .4rem .9rem; border: 1px solid var(--line);
  border-radius: var(--rp-radius-sm); background: var(--rp-raise); color: var(--ink); font-size: .86rem; font-weight: 700;
}
.rp-subcats a:hover { border-color: var(--red); color: var(--red); }
@media (max-width: 380px) { .rp-tile { min-height: 84px; font-size: .8rem; } .rp-tile svg { width: 28px; height: 28px; } .rp-tiles { padding: 0 .75rem; } }

/* ---------- Listing cards / grid ---------- */
.card, .home-gallery-track > * {
  border-radius: var(--rp-radius);
}
.card { background: var(--rp-card); border: 1px solid var(--line); box-shadow: none; }
body.dark .card { background: var(--rp-card); }
.card:hover { box-shadow: 0 6px 20px #0000001f; }
.card-title { color: var(--ink); }
.card-meta { color: var(--muted); }
.card-price { color: var(--red); }
body.dark .card-title { color: var(--ink); }

/* ---------- Search & filter: compact, two-column, clear groups ---------- */
.marketplace-filter-toggle { border-radius: var(--rp-radius-sm); }
.search-submit { background: var(--red); border-radius: var(--rp-radius-sm); }
#category-filter-overlay .modal { background: var(--rp-card); color: var(--ink); border-radius: var(--rp-radius); }
#category-filter-overlay .modal-header { background: var(--rp-card); border-bottom-color: var(--line); }
#category-filter-overlay .modal-body .form-group { margin-bottom: .7rem; }
#category-filter-overlay .category-filter-section {
  border: 1px solid var(--line); border-radius: var(--rp-radius-sm); padding: .75rem .75rem .1rem; margin-bottom: .75rem;
  background: var(--rp-raise);
}
#category-filter-overlay label { color: var(--muted); font-size: .74rem; letter-spacing: .02em; text-transform: uppercase; }
#category-filter-overlay :is(input, select) { border-radius: var(--rp-radius-sm); background: var(--paper); color: var(--ink); border-color: var(--line); min-height: 44px; }
#category-filter-overlay .btn-red, #category-filter-overlay button[type="submit"] { border-radius: var(--rp-radius-sm); }
@media (min-width: 701px) { #category-filter-overlay .modal { max-width: 640px; } }

/* ---------- Bottom navigation ---------- */
.bottom-nav { border-radius: 16px; }
body.dark .bottom-nav { background: rgba(23, 24, 26, .97); border-color: var(--line); }
.bottom-nav button.active:not(.bottom-insert), .bottom-nav button:hover:not(.bottom-insert) { color: var(--red); }
body.dark .bottom-nav button { color: #b9bec3; }
@media (max-width: 700px) {
  .bottom-nav { border-radius: 0; }
  .bottom-nav button.active:not(.bottom-insert), .bottom-nav button:hover:not(.bottom-insert) { background: color-mix(in srgb, var(--red) 11%, transparent); color: var(--red); }
  body.dark .bottom-nav button.active:not(.bottom-insert), body.dark .bottom-nav button:hover:not(.bottom-insert) { background: color-mix(in srgb, var(--red) 18%, transparent); color: #ff6b72; }
  .bottom-nav .bottom-insert, body.dark .bottom-nav .bottom-insert { background: var(--red); border-radius: 14px; }
}
.bottom-nav button:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }

/* ---------- Chat: red outgoing, dark grey incoming ---------- */
.chat-message-row.mine .chat-message, body.dark .chat-message-row.mine .chat-message { background: var(--red); border-color: var(--red-deep); color: #fff; }
.chat-message-row.mine .chat-message::after, body.dark .chat-message-row.mine .chat-message::after { background: var(--red); border-color: var(--red-deep); }
.chat-message-row:not(.mine) .chat-message { background: #e8e9eb; border-color: #d6d8db; color: #17181a; }
.chat-message-row:not(.mine) .chat-message::after { background: #e8e9eb; border-color: #d6d8db; }
body.dark .chat-message-row:not(.mine) .chat-message { background: #2a2d31; border-color: #393d42; color: #f2f3f4; }
body.dark .chat-message-row:not(.mine) .chat-message::after { background: #2a2d31; border-color: #393d42; }
body.dark .chat-modal, body.dark .chat-modal .modal-header, body.dark #chat-listing { background: var(--rp-card); }
.chat-listing { border-radius: var(--rp-radius-sm); }

/* ---------- Mein Bereich overview (real counts only) ---------- */
#area-overlay.account-open .account-profile .account-stats { display: none; }
.rp-account-overview { display: grid; gap: .6rem; margin: 0 0 1.1rem; }
.rp-account-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: var(--rp-radius); background: var(--rp-card); }
.rp-account-stats > div { padding: .7rem .4rem; text-align: center; min-width: 0; }
.rp-account-stats > div + div { border-left: 1px solid var(--line); }
.rp-account-stats dd { margin: 0; color: var(--ink); font-size: 1.3rem; font-weight: 850; font-variant-numeric: tabular-nums; line-height: 1.15; }
.rp-account-stats dt { order: 2; color: var(--muted); font-size: .76rem; font-weight: 700; }
.rp-account-stats > div { display: flex; flex-direction: column-reverse; }
.rp-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.rp-entry {
  position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: end; gap: .45rem .3rem;
  min-width: 0; min-height: 92px; padding: .75rem; border: 1px solid var(--line); border-radius: var(--rp-radius);
  background: var(--rp-card); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  transition: border-color .18s var(--rp-ease), transform .18s var(--rp-ease);
}
.rp-entry-icon { grid-column: 1; grid-row: 1; align-self: start; color: var(--red); }
.rp-entry-icon svg, .rp-entry-arrow svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rp-entry-icon svg { width: 26px; height: 26px; }
.rp-entry-label { grid-column: 1; grid-row: 2; font-size: .95rem; font-weight: 750; line-height: 1.25; overflow-wrap: anywhere; }
.rp-entry-arrow { grid-column: 2; grid-row: 2; color: var(--muted); }
.rp-entry-arrow svg { width: 18px; height: 18px; }
.rp-entry-badge { grid-column: 2; grid-row: 1; align-self: start; min-width: 24px; padding: .12rem .45rem; border-radius: 999px; background: var(--red); color: #fff; font-size: .74rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.rp-entry-wide { grid-template-columns: auto 1fr auto; grid-template-rows: auto; align-items: center; min-height: 56px; }
.rp-entry-wide .rp-entry-icon, .rp-entry-wide .rp-entry-label, .rp-entry-wide .rp-entry-arrow { grid-row: 1; align-self: center; }
.rp-entry-wide .rp-entry-icon { grid-column: 1; } .rp-entry-wide .rp-entry-label { grid-column: 2; } .rp-entry-wide .rp-entry-arrow { grid-column: 3; }
.rp-entry:hover { border-color: var(--red); }
.rp-entry:active { transform: scale(.985); }
.rp-entry:focus-visible { outline: 3px solid color-mix(in srgb, var(--red) 70%, transparent); outline-offset: 2px; }
.rp-section-title { margin: .4rem 0 0; font-size: 1.12rem; font-weight: 800; color: var(--ink); scroll-margin-top: .5rem; }
.rp-section-title:focus { outline: none; }
@media (max-width: 340px) { .rp-entry-grid { grid-template-columns: minmax(0, 1fr); } .rp-entry { min-height: 64px; } }
#area-overlay.account-open article.account-listing { border-radius: var(--rp-radius); background: var(--rp-card); }
#area-overlay.account-open .account-listing-actions button { border-radius: var(--rp-radius-sm); }

/* ---------- Listing composer: stepper + stage status ---------- */
#nl-overlay .modal,
.modal.rp-composer-preview {
  display: flex; flex-direction: column; overflow: hidden;
  height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}
#nl-overlay .modal-header, .rp-composer-preview .modal-header { flex: 0 0 auto; }
#nl-overlay .modal-body {
  display: flex; flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 0;
}
#nl-form {
  display: flex; flex-direction: column; flex: 1 1 auto;
  width: 100%; min-height: 0; overflow: hidden;
}
#nl-form > .rp-stepper-host { flex: 0 0 auto; padding: .85rem 1rem .65rem; background: var(--paper); }
#nl-form > .rp-stepper-host .rp-stepper { margin: 0; }
#nl-form > .rp-stage-status { flex: 0 0 auto; margin: 0 1rem .5rem; max-height: 20dvh; overflow: auto; }
#nl-form .nl-scroll-fields, .rp-composer-preview .rp-preview-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 1rem; scroll-padding-block: 1rem;
}
#nl-form .listing-form-actions, .rp-composer-preview .preview-actions {
  flex: 0 0 auto; margin: 0; padding: .75rem 1rem max(.75rem, env(safe-area-inset-bottom));
  position: relative; bottom: auto;
  background: var(--paper); border-top: 1px solid var(--line);
}
#nl-form > :is(.err, .ok) {
  flex: 0 1 auto; min-height: 0; max-height: 22dvh; overflow-y: auto; margin: 0 1rem .5rem;
}
.rp-composer-preview .modal-body {
  display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; padding: 0;
}
.rp-composer-preview .rp-preview-steps { flex: 0 0 auto; margin: 0; padding: .85rem 1rem .65rem; background: var(--paper); }
.rp-composer-preview .rp-preview-steps .rp-stepper { margin: 0; }
.rp-stepper { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; list-style: none; margin: 0 0 1rem; padding: 0; counter-reset: none; }
.rp-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 0; color: var(--muted); font-size: .8rem; font-weight: 700; text-align: center; }
.rp-step::before { content: ""; position: absolute; top: 15px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 2px; background: var(--line); }
.rp-step:first-child::before { display: none; }
.rp-step.is-done::before, .rp-step.is-current::before { background: var(--red); }
.rp-step-dot { display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.rp-step.is-done .rp-step-dot { border-color: var(--red); background: var(--red); color: #fff; }
.rp-step.is-current { color: var(--ink); }
.rp-step.is-current .rp-step-dot { border-color: var(--red); color: var(--red); }
.rp-step.is-busy .rp-step-dot { animation: rp-pulse 1.2s ease-in-out infinite; }
.rp-step.is-error .rp-step-dot { border-color: #b45309; color: #b45309; }
.rp-step-label { overflow-wrap: anywhere; }
#nl-form .rp-step-label { font-size: .85rem; }
.rp-stage-status { margin: -.35rem 0 1rem; padding: .7rem .85rem; border-radius: var(--rp-radius-sm); border: 1px solid var(--line); background: var(--rp-raise); color: var(--ink); font-size: .92rem; line-height: 1.45; }
.rp-stage-status[hidden] { display: none; }
.rp-stage-status[data-state="error"] { border-color: #d97706; background: color-mix(in srgb, #d97706 10%, var(--paper)); }
.rp-preview-steps { margin-bottom: .5rem; }
#nl-form .listing-form-actions .btn, #preview-overlay .btn { border-radius: var(--rp-radius-sm); }
#nl-overlay .modal, #preview-overlay .modal { background: var(--paper); color: var(--ink); }
body.dark #preview-overlay .modal, body.dark #preview-overlay .modal-header { background: var(--rp-card); }
@keyframes rp-pulse { 50% { opacity: .45; } }

/* ---------- Icon-led technical facts (detail + preview) ---------- */
.detail-info-item:has(> .rp-fact-icon), .preview-fact:has(> .rp-fact-icon) {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: .6rem; align-items: center;
}
.detail-info-item:has(> .rp-fact-icon) > :not(.rp-fact-icon) { grid-column: 2; }
.detail-info-item:has(> .rp-fact-icon) > .rp-fact-icon { grid-row: 1 / span 2; }
.rp-fact-icon { display: grid; place-items: center; width: 26px; height: 26px; color: var(--red); }
.rp-fact-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.preview-fact-copy { display: flex; flex-direction: column; min-width: 0; }
.preview-fact-copy strong { overflow-wrap: anywhere; }
body.dark .detail-info-item { background: var(--rp-raise); color: var(--ink); }
body.dark #preview-overlay :is(.preview-fact, .preview-description, .preview-meta span) {
  background: var(--rp-raise); color: var(--ink); border-color: var(--line);
}
body.dark #preview-overlay .preview-fact small { color: var(--muted); }
body.dark #preview-overlay .preview-fact strong { color: var(--ink); }
body.dark #preview-overlay .preview-status { background: #402025; color: #ffb4ba; }
body.dark #preview-overlay .btn-gray { background: var(--rp-raise); color: var(--ink); border: 1px solid var(--line); }
body:not(.dark) .detail-info-item { background: var(--rp-card); border: 1px solid var(--line); }

/* ---------- Shared feedback ---------- */
/* Acknowledgements belong above navigation, including on short phone screens. */
#listing-success-overlay {
  position: fixed; inset: 0; z-index: 950;
  align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
}
#listing-success-overlay > .modal {
  width: min(100%, 540px); min-height: 0; margin: auto;
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
}
body.dark #listing-success-overlay > .modal { background: var(--rp-card); color: var(--ink); }
body, button, input, select, textarea, .rp-tile, .rp-entry { font-family: var(--rp-font); }
.card-price, .home-gallery-price { font-size: 1.2rem; font-weight: 800; }
@media (max-width: 700px) {
  body { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  :is(#area-overlay, #category-filter-overlay, #detail-overlay) .modal-body {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}
:is(.btn, .rp-tile, .rp-entry, .bottom-nav button):focus-visible { outline: 3px solid color-mix(in srgb, var(--red) 75%, transparent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .rp-tile, .rp-entry, .card { transition: none !important; }
  .rp-step.is-busy .rp-step-dot { animation: none; }
  .card:hover, .rp-tile:active, .rp-entry:active { transform: none; }
}

/* ---------- Typography: system / Inter ---------- */
body, button, input, select, textarea, .rp-tile { font-family: var(--rp-font); }

/* ---------- Composer stages (wizard variant only; classic shows 1+2 together) ---------- */
#nl-form .rp-wizard-only { display: none; }
#nl-form[data-rp-variant="wizard"][data-rp-stage-current="1"] [data-rp-stage="2"],
#nl-form[data-rp-variant="wizard"][data-rp-stage-current="2"] [data-rp-stage="1"] { display: none; }
#nl-form[data-rp-variant="wizard"][data-rp-stage-current="1"] #rp-wizard-next,
#nl-form[data-rp-variant="wizard"][data-rp-stage-current="2"] #rp-wizard-back { display: inline-flex; align-items: center; justify-content: center; }
#nl-form[data-rp-variant="wizard"][data-rp-stage-current="1"] #nl-preview-submit { display: none; }
#nl-form [data-rp-stage] { animation: rp-stage-in .24s var(--rp-ease) both; }
@keyframes rp-stage-in { from { opacity: 0; transform: translateY(6px); } }
#nl-form .btn, #preview-overlay .btn, .rp-entry, .bottom-nav button { min-height: var(--rp-touch); }
#preview-overlay .preview-actions #preview-publish-btn { font-weight: 800; }
@media (prefers-reduced-motion: reduce) { #nl-form [data-rp-stage] { animation: none; } }

/* ---------- Home: reference structure (brand, search, 3 tiles, Aktuelle Angebote, Inserieren) ---------- */
.rp-tile span { line-height: 1.2; }
.rp-tile.active { background: var(--red); border-color: var(--red); color: #fff; }
body.home-mode #listings { display: none; }
body.results-mode :is(.rp-tiles, .rp-home-insert, .app-downloads) { display: none !important; }
.home-gallery-head { align-items: center; }
.rp-all-link { display: inline-flex; align-items: center; gap: .2rem; min-height: 44px; color: var(--ink); font-size: .9rem; font-weight: 650; }
.rp-all-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rp-all-link:hover { color: var(--red); }
.home-gallery-track { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; overflow: visible; scroll-snap-type: none; padding: 0; }
@media (min-width: 701px) { .home-gallery-track { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; } }
.home-gallery-card { flex: none; width: auto; border-radius: var(--rp-radius); background: var(--rp-card) !important; color: var(--ink) !important; border-color: var(--line); }
.home-mode .home-gallery-card img { height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
@media (min-width: 701px) { .home-mode .home-gallery-card img { aspect-ratio: 4 / 3; } }
.home-gallery-category { display: none; }
.home-mode .home-gallery-title { font-size: .95rem; font-weight: 750; line-height: 1.3; }
.home-gallery-spec { display: block; margin-top: .1rem; color: var(--muted); font-size: .8rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
body.dark .home-gallery-card { background: #141417 !important; border-color: #2a2a2f; }
.home-gallery-price { color: var(--red) !important; font-size: 1.05rem; font-weight: 850; margin-top: .25rem; }
.home-gallery-controls { display: none !important; }
.rp-home-insert { max-width: 1240px; margin: 1.25rem auto .5rem; padding: 0 1.25rem; }
.rp-insert-cta { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 52px; border-radius: var(--rp-radius); font-size: 1rem; font-weight: 800; background: var(--red); color: #fff; border: 0; }
.rp-insert-cta svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (min-width: 701px) { .rp-insert-cta { width: auto; padding: 0 2rem; margin: 0 auto; } }
@media (max-width: 700px) { nav:not(.bottom-nav) .category-navigation { display: none; } .home-gallery { padding-inline: .9rem; } }

/* ---------- Chips (filter + composer) ---------- */
.rp-filter-group { margin: 0 0 .9rem; }
.rp-filter-label { display: block; margin: 0 0 .45rem; color: var(--muted); font-size: .76rem; font-weight: 750; text-transform: uppercase; letter-spacing: .03em; }
.rp-chip-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.rp-chip { min-height: 44px; padding: .5rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--rp-raise); color: var(--ink); font: 700 .9rem var(--rp-font); cursor: pointer; transition: background-color .15s, border-color .15s; }
.rp-chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.rp-chip:hover:not([aria-pressed="true"]) { border-color: var(--red); }
.rp-chip:focus-visible { outline: 3px solid color-mix(in srgb, var(--red) 70%, transparent); outline-offset: 2px; }
.rp-chip-quiet { background: transparent; font-weight: 600; color: var(--muted); }
.rp-cat-sub { margin-top: .7rem; }
.rp-cat-sub[hidden] { display: none; }
.rp-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: -1px !important; overflow: hidden; clip: rect(0 0 0 0); border: 0 !important; }
.nl-category-wrap { position: relative; }
#category-filter-overlay .category-filter-section { background: transparent; }

/* ---------- Suche & Filter panel structure ---------- */
#category-filter-overlay .modal-header { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: .4rem; }
#category-filter-overlay .modal-header h2 { text-align: center; font-size: 1.08rem; }
#category-filter-overlay .modal-close { width: 44px; height: 44px; color: var(--ink); }
.rp-header-reset { min-height: 44px; padding: 0 .5rem; border: 0; background: transparent; color: var(--muted); font: 600 .86rem var(--rp-font); cursor: pointer; }
.rp-header-reset:hover { color: var(--red); }
#category-filter-overlay .rp-filter-group { margin: 0 0 .65rem; padding: 0 0 .65rem; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
#category-filter-overlay .rp-filter-group > .form-group:last-child,
#category-filter-overlay .rp-filter-group > .form-row:last-child { margin-bottom: 0; }
#category-filter-overlay .category-filter-section.rp-filter-group:not(.active) { display: none; }
#category-filter-overlay .rp-filter-label { display: flex; align-items: center; gap: .5rem; color: var(--ink); font-size: .95rem; font-weight: 750; text-transform: none; letter-spacing: 0; }
#category-filter-overlay .rp-filter-label svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
#category-filter-overlay label { text-transform: none; letter-spacing: 0; font-size: .78rem; font-weight: 600; }
#category-filter-overlay .rp-filter-season { margin: .7rem 0 0; }
.rp-size-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.rp-size-row .form-group { margin: 0; }
#category-filter-overlay .rfi-original,
#category-filter-overlay .rfi-size-part { display: none !important; }
#category-filter-overlay .rp-size-row { grid-template-columns: minmax(0, 1fr); }
#category-filter-overlay .modal-body:has(#category-filter-tires.active) #category-diameter-group { display: none; }
.rfi-combined-size small { display: block; margin-top: .4rem; color: var(--muted); font-size: .8rem; }
.rfi-choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.rfi-choices .rp-chip { min-height: 44px; }
.rp-size-generic { display: none; }
.modal-body:has(#category-filter-tires:not(.active)) .rp-tire-only { display: none !important; }
.modal-body:has(#category-filter-tires:not(.active)) .rp-size-generic { display: inline; }
.modal-body:has(#category-filter-tires:not(.active)) .rp-size-row { grid-template-columns: minmax(0, 1fr); }
.modal-body:has(#category-filter-rims:not(.active)) .rp-rim-only { display: none !important; }
.modal-body:has(#category-diameter-group.hidden) .rp-size-group { display: none; }
.rp-native-condition { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }
.rp-chip-row .rp-chip { flex: 1 1 auto; }
.rp-more-filters { margin: 0 0 1rem; border: 1px solid var(--line); border-radius: var(--rp-radius-sm); }
.rp-more-filters > summary { min-height: 48px; display: flex; align-items: center; padding: 0 1rem; font-weight: 750; cursor: pointer; }
.rp-more-filters-body { padding: 0 1rem .4rem; }
#category-filter-overlay .category-filter-actions { position: sticky; bottom: 0; display: grid; grid-template-columns: auto 1fr; gap: .5rem; padding: .75rem 0 calc(.25rem + env(safe-area-inset-bottom)); background: var(--rp-card); }
#category-filter-overlay .category-filter-actions .btn { min-height: 52px; border-radius: var(--rp-radius); }
#category-filter-overlay .category-filter-actions .btn-red { font-size: 1rem; font-weight: 800; }

/* ---------- Composer category picker ---------- */
.rp-cat-picker { display: grid; gap: .1rem; }
.rp-cat-hint { margin: .5rem 0 0; color: #ff8a8f; font-size: .86rem; font-weight: 650; }
body:not(.dark) .rp-cat-hint { color: #a3050e; }
.rp-cat-picker.is-invalid .rp-cat-sub .rp-chip, .rp-cat-picker.is-invalid > .rp-chip-row .rp-chip:not([aria-pressed="true"]) { border-color: var(--red); }

/* ---------- Home on phones: brand -> search -> tiles -> offers (location/radius live in Suche & Filter) ---------- */
@media (max-width: 700px) {
  #category-filter-overlay { padding: 0; align-items: stretch; }
  #category-filter-overlay .category-filter-modal { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  body.home-mode .sticky-search :is(.search-place, .search-divider, #radius-km) { display: none; }
  body.home-mode .sticky-save-search { display: none; }
  body.home-mode .sticky-search .search-submit { flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
  body.home-mode .rp-tiles { margin-top: .6rem; }
}

/* ---------- Meins: status tabs + logout ---------- */
.rp-status-tabs { display: flex; gap: .4rem; overflow-x: auto; margin: 0 0 .8rem; padding: .2rem; border-radius: 999px; background: var(--rp-raise); scrollbar-width: none; }
.rp-status-tab { flex: 1 0 auto; min-height: 44px; padding: 0 .9rem; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 700 .85rem var(--rp-font); cursor: pointer; white-space: nowrap; }
.rp-status-tab[aria-selected="true"] { background: var(--red); color: #fff; }
.rp-status-tab:focus-visible { outline: 3px solid color-mix(in srgb, var(--red) 70%, transparent); outline-offset: 2px; }
#area-overlay article.account-listing[hidden] { display: none; }
.rp-entry-logout .rp-entry-icon, .rp-entry-logout .rp-entry-label { color: var(--muted); }
.rp-account-overview > .rp-entry-wide + .rp-entry-wide { margin-top: -.1rem; }

/* ---------- Chat: round red send, rounded composer field ---------- */
#chat-form .chat-send { border-radius: 50% !important; background: var(--red) !important; border-color: var(--red) !important; color: #fff !important; }
#chat-form textarea#chat-input { border-radius: 22px; }
#chat-form { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; align-items: end; }
#chat-form .chat-composer-shell { grid-column: 1; display: flex; align-items: end; gap: 6px; min-width: 0; }
#chat-form :is(.chat-image-preview, .chat-emoji-panel, .chat-composer-status) { grid-column: 1 / -1; }
#chat-form #chat-input { flex: 1; min-width: 0; }
#chat-form #chat-send { grid-column: 2; grid-row: auto; width: 44px; height: 44px; padding: 10px; }
.rp-chat-tools { position: relative; flex: 0 0 44px; }
.rp-chat-tools > summary { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--rp-raise); color: var(--ink); cursor: pointer; list-style: none; }
.rp-chat-tools > summary::-webkit-details-marker { display: none; }
.rp-chat-tools > summary svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.rp-chat-tools > summary:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.rp-chat-tools-menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 5; width: min(230px, 70vw); padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--rp-card); box-shadow: 0 8px 28px #0006; }
#chat-form .rp-chat-tools-menu .chat-attach { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 44px; padding: 8px; color: var(--ink); border: 0; border-radius: 8px; font: 600 .85rem var(--rp-font); }
#chat-form .rp-chat-tools-menu .chat-attach svg { flex: 0 0 22px; width: 22px; height: 22px; }
#chat-form .rp-chat-tools-menu .chat-attach:hover { background: var(--rp-raise); }

/* Reference navigation: only the current destination is highlighted. */
body .bottom-nav button,
body .bottom-nav button.bottom-insert {
  position: relative;
  background: transparent !important;
  color: var(--muted) !important;
  border-color: transparent;
  box-shadow: none;
  transform: none;
  height: auto;
  min-height: 56px;
  margin-top: 0;
  border-radius: 0;
  font-weight: 500;
}
body .bottom-nav button.active,
body .bottom-nav button.bottom-insert.active {
  color: var(--red) !important;
  font-weight: 650;
}
body .bottom-nav .bottom-insert span:last-child { color: inherit !important; }
.home-gallery-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
body .home-gallery-price, body.home-mode .home-gallery-price { font-size: 1.2rem; font-weight: 800; color: var(--red); }
.home-gallery-location { display: flex; align-items: center; min-width: 0; max-width: 52%; gap: 3px; font-size: .68rem; font-weight: 500; color: var(--muted); }
.home-gallery-location svg { flex: 0 0 12px; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.home-gallery-location > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rp-footer-categories { max-width: 1240px; margin: 0 auto 1rem; padding: 0 1rem; color: var(--muted); font-size: .85rem; }
.rp-footer-categories > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.rp-footer-categories > summary::after { content: "+"; font-size: 1.2rem; }
.rp-footer-categories[open] > summary::after { content: "−"; }
.rp-footer-categories .legal-footer { padding-inline: 0; }

/* The filter has one full-width action; reset stays in the fixed header.
   No extra bottom padding inside this already navigation-safe modal. */
#category-filter-overlay .modal-body { padding-bottom: 0; }
#category-filter-overlay .category-filter-actions { grid-template-columns: 1fr; }
#category-filter-overlay .rp-chip-row[aria-label="Kategorie"] {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
}
#category-filter-overlay [data-rp-filter-cat] { min-width: 0; padding-inline: 3px; font-size: .78rem; }
.rp-filter-sub { margin: .6rem 0 .8rem; }
.rp-filter-sublabel { display: block; margin: 0 0 .4rem; color: var(--muted); font-size: .78rem; font-weight: 600; }
#category-filter-overlay .rp-more-filters .category-filter-section.active { display: block; margin: .2rem 0 .6rem; padding: 0; border: 0; }
#category-filter-overlay .rp-more-filters .rp-filter-season { margin: 0 0 .7rem; }
body.dark #category-filter-overlay .modal, body.dark #category-filter-overlay .modal-header, body.dark #category-filter-overlay .category-filter-actions { background: #0e0e10; }
body.dark #category-filter-overlay :is(input, select) { background: #141417; border-color: #2e2e33; color: #fff; }
body.dark #category-filter-overlay .rp-chip:not([aria-pressed="true"]) { background: #141417; border-color: #34343a; }
#category-filter-overlay .category-filter-actions { border-top: 0; }
.bottom-nav button.active::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: calc(50% - 12px);
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--red);
}
