:root{
  --bg-glass: rgba(255,255,255,.72);
  --white: #ffffff;
  --line: rgba(15,23,42,.08);
  --text: #0f172a;
  --muted: #6b7280;
  --accent: #3b82f6;

  --header-h: 56px;
  --bottom-nav-h: 68px;
  --action-size: 44px;
  --icon-size: 26px;
}

/* ================= RESET ================= */

*{
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.tp-brand,
.tp-brand:hover,
.tp-brand:visited,
.tp-brand:active{
  text-decoration: none;
  color: inherit;
}

html,
body{
  height: 100%;
}

html{
  scrollbar-gutter: stable;
}

body{
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 76px;
}

.page-content{
  flex: 1;
}

/* ================= HEADER ================= */

.tp-header{
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 900px;
  height: var(--header-h);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
  border-radius: 16px;
  z-index: 1000;
}

.tp-inner{
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 12px;
}

/* ================= LOGO ================= */

.tp-logo{
  background: linear-gradient(135deg,#1e3a8a,#2563eb,#3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 22px;
  font-weight: 900;
}

.tp-logo-accent{
  background: linear-gradient(135deg,#2563eb,#3b82f6,#60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ================= SEARCH ================= */

.tp-search{
  position: relative;
  flex: 1 1 auto;
  min-width: 240px;
  z-index: 1200;
}

.tp-searchbox{
  width: 100%;
  height: 40px;
  padding: 0 38px 0 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 14px;
  color: var(--text);
}

.tp-searchbox:focus{
  outline: none;
  box-shadow: none;
}

.tp-search:focus-within{
  outline: none;
  box-shadow: none;
}

.tp-search-icon{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2;
}

.tp-clear{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
}

.tp-clear svg{
  width: 16px;
  height: 16px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2;
}

/* ================= ACTIONS ================= */

.tp-actions{
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ================= ICON ACTIONS ================= */

.tp-help,
.tp-chat,
.tp-profile{
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  transition: background .18s ease, color .18s ease;
}

.tp-help:hover,
.tp-chat:hover,
.tp-profile:hover{
  background: transparent;
  color: #3b82f6;
}

.tp-help-svg,
.tp-chat-svg{
  width: var(--icon-size);
  height: var(--icon-size);
  fill: currentColor;
}

.tp-help > span,
#tpChatsLabel,
.tp-profilelabel{
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
}

/* ================= PROFILE ================= */

.tp-profile-svg{
  width: var(--icon-size);
  height: var(--icon-size);
  fill: currentColor;
}

/* ================= AUTH ================= */

.tp-btn{
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.tp-btn.is-active{
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ================= SEARCH OVERLAY ================= */

.tp-overlay{
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 900;
}

.tp-overlay.show{
  opacity: 1;
  pointer-events: auto;
}

/* ================= SEARCH DROP ================= */

.tp-drop{
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  width: 100%;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(15,23,42,.18);
  display: none;
  overflow: hidden;
  z-index: 1200;
  animation: tpDropIn .18s ease;
}

.tp-drop.show{
  display: block;
}

.tp-drop-header{
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.tp-drop-list{
  max-height: 420px;
  overflow-y: auto;
}

@keyframes tpDropIn{
  from{
    opacity: 0;
    transform: translateY(-6px) scale(.98);
  }
  to{
    opacity: 1;
    transform: none;
  }
}

/* ================= SEARCH ROW ================= */

.tp-row{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
}

.tp-row:hover{
  background: rgba(37,99,235,.06);
}

.tp-row-img{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: contain;
  background: #f8fafc;
  flex-shrink: 0;
}

.tp-row-text{
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tp-row-text b{
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-row-text small{
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.tp-row-empty{
  padding: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  cursor: default;
}

/* ================= SEARCH MODE ================= */

body.tp-search-open .tp-brand,
body.tp-search-open .tp-actions{
  opacity: .25;
  pointer-events: none;
  transition: opacity .2s ease;
}

body.tp-search-open .tp-search{
  opacity: 1;
  pointer-events: auto;
}

/* ================= DESKTOP CHAT BADGE ================= */

.tp-chat-icon-wrap{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  overflow: visible;
}

.tp-chat-badge{
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* ================= BURGER ================= */

.tp-burger{
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color .2s ease;
}

.tp-burger:hover{
  color: #3b82f6;
}

.tp-burger-svg{
  width: var(--icon-size);
  height: var(--icon-size);
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

.tp-burger-svg line,
.tp-mobile-burger svg line{
  transition: transform .22s ease, opacity .18s ease;
  transform-origin: center;
  transform-box: fill-box;
}

.tp-burger.is-open,
.tp-mobile-burger.is-open{
  color: var(--accent);
}

.tp-burger.is-open .tp-burger-svg line:nth-child(1),
.tp-mobile-burger.is-open svg line:nth-child(1){
  transform: translateY(5px) rotate(45deg);
}

.tp-burger.is-open .tp-burger-svg line:nth-child(2),
.tp-mobile-burger.is-open svg line:nth-child(2){
  opacity: 0;
}

.tp-burger.is-open .tp-burger-svg line:nth-child(3),
.tp-mobile-burger.is-open svg line:nth-child(3){
  transform: translateY(-5px) rotate(-45deg);
}

.tp-burger-wrap{
  position: relative;
}

.tp-burger-panel{
  position: fixed;
  top: 76px;
  right: calc((100vw - 900px) / 2 + 24px);
  width: 240px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.12);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: .18s ease;
  z-index: 2000;
}

.tp-burger-panel.show{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.tp-burger-row{
  width: 100%;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background .18s ease;
}

.tp-burger-row:hover{
  background: rgba(37,99,235,.06);
}

.tp-burger-row + .tp-burger-row,
.tp-burger-row + .tp-burger-sub{
  border-top: 1px solid var(--line);
}

/* ================= SUBMENU ================= */

.tp-burger-sub{
  display: none;
  flex-direction: column;
  background: #fafafa;
}

.tp-burger-sub.open{
  display: flex;
}

.tp-burger-sub .tp-item{
  padding: 14px 18px;
  font-size: 14px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease;
}

.tp-burger-sub .tp-item:hover{
  background: rgba(37,99,235,.08);
}

.tp-burger-sub .tp-item + .tp-item{
  border-top: 1px solid #eceff3;
}

.tp-burger-caret{
  width: 14px;
  height: 14px;
  opacity: .6;
  transition: transform .2s ease;
}

.tp-burger-row.open .tp-burger-caret{
  transform: rotate(180deg);
}

/* ================= ACTIVE ================= */

.tp-help.is-active,
.tp-chat.is-active,
.tp-profile.is-active,
.tp-burger.is-active{
  color: var(--accent);
}

/* ================= MOBILE TOGGLES ================= */

.tp-header{
  display: block;
}

.tp-header-mobile,
.tp-bottom-mobile{
  display: none;
}

/* только реальные телефоны */
@media (max-width: 768px){
  .tp-header{
    display: none !important;
  }

  .tp-header-mobile{
    display: block !important;
  }

  .tp-bottom-mobile{
    display: flex !important;
  }
}

/* ================= PHONE STYLES ================= */

@media (max-width: 768px){

  .tp-header-mobile{
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    height: 56px;
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 16px;
    z-index: 1000;
    will-change: transform;
    transform: translateZ(0);
  }

    body{
    padding-bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom));
  }

  .tp-mobile-inner{
    height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    min-width: 0;
  }

  .tp-mobile-logo{
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    flex: 0 0 auto;
    min-width: 0;
  }

  .tp-mobile-logo .tp-logo{
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1.15;
  }

  .tp-mobile-search{
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
  }

  .tp-mobile-search input{
    -webkit-tap-highlight-color: transparent;
    transition: none;
    -webkit-appearance: none;
    outline: none;
    box-shadow: none;
    width: 100%;
    height: 36px;
    padding: 0 36px;
    border-radius: 5px;
    background: rgba(255,255,255,.35);
    backdrop-filter: blur(10px);
    border: 1px solid #e5e7eb;
    font-size: 16px;
    color: var(--text);
  }

  .tp-mobile-search input::placeholder{
    color: #7b7b7c;
    opacity: 1;
    font-weight: 500;
  }

  .tp-mobile-search-icon{
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: #666;
    fill: none;
    stroke-width: 2;
  }

  .tp-mobile-burger{
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: color .2s ease;
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
  }

  .tp-mobile-burger svg{
    width: 26px;
    height: 26px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
  }

  .tp-mobile-burger:hover{
    color: var(--accent);
  }

  .tp-bottom-mobile{
    will-change: transform, opacity;
    transform: translate3d(0,0,0);
    opacity: 1;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: auto;
    z-index: 3000;
    height: var(--bottom-nav-h);
    padding: 0 8px;
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(15,23,42,.10);
    display: flex;
    justify-content: space-around;
    align-items: center;
    transition: transform .22s ease, opacity .22s ease;
  }

  .tp-bottom-item{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 54px;
    padding: 6px 8px;
    border-radius: 14px;
    font-size: 11px;
    text-decoration: none;
    color: #6b7280;
    position: relative;
    transition: background .18s ease, color .18s ease;
  }

  .tp-bottom-item svg{
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    display: block;
    flex-shrink: 0;
    fill: currentColor;
  }

  .tp-bottom-item.is-active{
    color: var(--accent);
    background: rgba(59,130,246,.08);
  }

  .tp-bottom-item.is-active svg{
    fill: var(--accent);
  }

  .tp-drop{
    position: fixed;
    left: 12px;
    right: 12px;
    top: 78px;
    width: auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15,23,42,.18);
    max-height: min(60vh, 420px);
    overflow: hidden;
    z-index: 1200;
  }

  .tp-drop-list{
    max-height: min(60vh, 420px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tp-row{
    padding: 12px 14px;
  }

  .tp-row-img{
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

.tp-bottom-chat-icon-wrap{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  overflow: visible;
}

.tp-bottom-chat-badge{
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
}

@media (max-width: 380px){
  .tp-mobile-inner{
    gap: 8px;
    padding: 0 10px;
  }

  .tp-mobile-logo .tp-logo{
    font-size: 20px;
  }

  .tp-mobile-search input{
    padding-left: 32px;
    padding-right: 10px;
  }
}

/* ================= iOS FIX ================= */

@supports (-webkit-touch-callout: none) {
  @media (max-width: 768px){
    .tp-header-mobile,
    .tp-bottom-mobile{
      position: fixed !important;
      transform: translate3d(0,0,0);
      -webkit-transform: translate3d(0,0,0);
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
      perspective: 1000px;
      -webkit-perspective: 1000px;
    }
  }
}

@media (max-width: 768px){
  .tp-burger-panel{
    right: 12px;
  }
}

@media (max-width: 768px){
  body.tp-keyboard-open .tp-bottom-mobile{
    display: none !important;
  }
}
/* ===== Stability fixes: mobile header / bottom nav / safe scrolling ===== */
@media (max-width: 768px){
  body{
    padding-top: calc(76px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--bottom-nav-h) + 24px + env(safe-area-inset-bottom, 0px));
  }

  .tp-header-mobile{
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 10px;
    right: 10px;
  }

  .tp-mobile-inner{
    gap: 8px;
    padding: 0 10px;
    min-width: 0;
  }

  .tp-mobile-logo{
    flex: 0 1 auto;
    max-width: 116px;
    overflow: hidden;
  }

  .tp-mobile-logo .tp-logo{
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tp-mobile-search{
    flex: 1 1 0;
    min-width: 92px;
  }

  .tp-mobile-search input{
    min-width: 0;
    padding-left: 34px;
    padding-right: 10px;
  }

  .tp-mobile-burger{
    flex: 0 0 40px;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 7px;
  }

  html{
    scroll-padding-top: calc(88px + env(safe-area-inset-top, 0px));
    scroll-padding-bottom: calc(var(--bottom-nav-h) + 36px + env(safe-area-inset-bottom, 0px));
  }

  input,
  select,
  textarea,
  button{
    scroll-margin-bottom: calc(var(--bottom-nav-h) + 42px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 360px){
  .tp-mobile-logo{
    max-width: 92px;
  }

  .tp-mobile-logo .tp-logo{
    font-size: 18px;
  }

  .tp-mobile-search{
    min-width: 78px;
  }

  .tp-mobile-burger{
    flex-basis: 38px;
    width: 38px;
    min-width: 38px;
  }
}

body.offer-create-page{
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}


/* Sell bottom-nav icon: central plus as a real SVG circle, consistent with other bottom icons */
.tp-bottom-sell .tp-bottom-sell-svg{
  width:26px;
  height:26px;
  min-width:26px;
  min-height:26px;
  display:block;
  flex-shrink:0;
  fill:none !important;
}

.tp-bottom-sell .tp-bottom-sell-circle{
  fill:currentColor !important;
  stroke:none !important;
}

.tp-bottom-sell .tp-bottom-sell-plus{
  fill:none !important;
  stroke:#ffffff !important;
  stroke-width:2.45;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.tp-bottom-sell.is-active{
  color:var(--accent);
}

.tp-bottom-sell.is-active .tp-bottom-sell-circle{
  fill:var(--accent) !important;
}

.tp-bottom-sell.is-active .tp-bottom-sell-plus{
  stroke:#ffffff !important;
}

/* ===== TyPlace page loader: short branded reload transition ===== */
.tp-page-loader{
  position:fixed;
  inset:0;
  z-index:10000;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg, rgba(245,246,248,.98), rgba(255,255,255,.98));
  opacity:1;
  pointer-events:auto;
  transition:opacity .22s ease, visibility .22s ease;
}

.tp-page-loader.hide{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

.tp-page-loader-card{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 18px;
  border-radius:20px;
  background:rgba(255,255,255,.78);
  border:1px solid rgba(255,255,255,.58);
  box-shadow:0 20px 60px rgba(15,23,42,.10);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}

.tp-page-loader-mark{
  width:28px;
  height:28px;
  color:var(--accent);
  animation:tpLoaderPulse 1s ease-in-out infinite;
}

.tp-page-loader-text{
  background:linear-gradient(135deg,#1e3a8a,#2563eb,#3b82f6);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  font-size:20px;
  font-weight:900;
  letter-spacing:-.04em;
}

@keyframes tpLoaderPulse{
  0%,100%{ transform:scale(1); opacity:.72; }
  50%{ transform:scale(1.08); opacity:1; }
}

@media (prefers-reduced-motion: reduce){
  .tp-page-loader,
  .tp-page-loader-mark{
    animation:none !important;
    transition:none !important;
  }
}

/* ===== Burger: links, icons, theme row ===== */
.tp-burger-row-left{
  min-width:0;
  display:inline-flex;
  align-items:center;
  gap:10px;
}

.tp-burger-row-icon{
  width:18px;
  height:18px;
  stroke:currentColor;
  fill:none;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
  flex:0 0 auto;
  opacity:.82;
}

.tp-burger-value{
  color:var(--muted);
  font-size:13px;
  font-weight:700;
  white-space:nowrap;
}

.tp-burger-link,
.tp-burger-link:visited,
.tp-burger-link:hover,
.tp-burger-link:active{
  text-decoration:none;
}

.tp-burger-row + .tp-burger-theme,
.tp-burger-row + .tp-burger-link,
.tp-burger-sub + .tp-burger-theme,
.tp-burger-theme + .tp-burger-link{
  border-top:1px solid var(--line);
}

/* ===== Theme variables: applied by html[data-tp-theme] ===== */
html[data-tp-theme="dark"]{
  color-scheme:dark;
  --bg-glass:rgba(15,23,42,.72);
  --white:#111827;
  --line:rgba(148,163,184,.18);
  --text:#f8fafc;
  --muted:#94a3b8;
  --accent:#60a5fa;
}

html[data-tp-theme="dark"] body:not(.offer-create-page){
  background:#0b1120;
  color:#f8fafc;
}

html[data-tp-theme="dark"] .tp-header,
html[data-tp-theme="dark"] .tp-header-mobile,
html[data-tp-theme="dark"] .tp-bottom-mobile{
  background:rgba(15,23,42,.72);
  border-color:rgba(148,163,184,.16);
  box-shadow:0 10px 34px rgba(0,0,0,.28);
}

html[data-tp-theme="dark"] .tp-searchbox,
html[data-tp-theme="dark"] .tp-mobile-search input,
html[data-tp-theme="dark"] .tp-burger-panel,
html[data-tp-theme="dark"] .tp-burger-row,
html[data-tp-theme="dark"] .tp-drop{
  background:#111827;
  color:#f8fafc;
  border-color:rgba(148,163,184,.22);
}

html[data-tp-theme="dark"] .tp-mobile-search input{
  background:rgba(15,23,42,.62);
}

html[data-tp-theme="dark"] .tp-searchbox::placeholder,
html[data-tp-theme="dark"] .tp-mobile-search input::placeholder{
  color:#94a3b8;
}

html[data-tp-theme="dark"] .tp-burger-sub,
html[data-tp-theme="dark"] .tp-row{
  background:#0f172a;
  color:#f8fafc;
}

html[data-tp-theme="dark"] .tp-burger-row:hover,
html[data-tp-theme="dark"] .tp-burger-sub .tp-item:hover,
html[data-tp-theme="dark"] .tp-row:hover{
  background:rgba(96,165,250,.10);
}

html[data-tp-theme="dark"] .tp-page-loader{
  background:linear-gradient(180deg, rgba(11,17,32,.98), rgba(15,23,42,.98));
}

html[data-tp-theme="dark"] .tp-page-loader-card{
  background:rgba(15,23,42,.78);
  border-color:rgba(148,163,184,.18);
}

.tp-row-subtitle{
  margin-top:2px;
  color:var(--muted);
  font-size:12px;
  line-height:1.25;
}

/* ===== Final dark theme + loader fixes ===== */
html[data-tp-theme="dark"]{
  color-scheme:dark;
  --tp-dark-bg:#080d19;
  --tp-dark-surface:#111827;
  --tp-dark-surface-2:#1f2937;
  --tp-dark-line:rgba(148,163,184,.22);
  --tp-dark-text:#f8fafc;
  --tp-dark-muted:#94a3b8;
  --bg:#080d19;
  --card:#111827;
  --chip:#1f2937;
  --chipHover:#263244;
  --chipActive:#3b82f6;
  --chipActiveText:#ffffff;
  --btnText:#f8fafc;
  --btnBg:#1f2937;
  --btnHover:#263244;
}

html[data-tp-theme="dark"] body{
  background:var(--tp-dark-bg) !important;
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] :is(.page-content, main, .page, .content, .container){
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] :is(.tp-header,.tp-header-mobile,.tp-bottom-mobile){
  background:rgba(17,24,39,.86) !important;
  border-color:rgba(148,163,184,.18) !important;
  box-shadow:0 18px 46px rgba(0,0,0,.34) !important;
}

html[data-tp-theme="dark"] :is(.tp-searchbox,.tp-mobile-search input){
  background:rgba(15,23,42,.70) !important;
  color:var(--tp-dark-text) !important;
  border-color:rgba(148,163,184,.24) !important;
}

html[data-tp-theme="dark"] :is(.tp-searchbox,.tp-mobile-search input)::placeholder{
  color:var(--tp-dark-muted) !important;
  opacity:1 !important;
}

html[data-tp-theme="dark"] :is(.tp-search-icon,.tp-mobile-search-icon,.tp-clear svg){
  stroke:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] :is(.tp-burger-panel,.tp-burger-row,.tp-drop,.tp-drop-list,.tp-burger-sub,.tp-burger-sub .tp-item,.tp-row){
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(.tp-burger-row:hover,.tp-burger-sub .tp-item:hover,.tp-row:hover){
  background:rgba(96,165,250,.10) !important;
}

html[data-tp-theme="dark"] :is(.tp-burger-value,.tp-row-text small,.tp-row-subtitle,.tp-row-empty){
  color:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] .tp-row-text b{ color:var(--tp-dark-text) !important; }
html[data-tp-theme="dark"] .tp-row-img{ background:var(--tp-dark-surface-2) !important; }
html[data-tp-theme="dark"] .tp-overlay{ background:rgba(0,0,0,.58) !important; }

html[data-tp-theme="dark"] .tp-bottom-item{ color:var(--tp-dark-muted) !important; }
html[data-tp-theme="dark"] .tp-bottom-item.is-active{
  color:#60a5fa !important;
  background:rgba(59,130,246,.16) !important;
}
html[data-tp-theme="dark"] .tp-bottom-sell .tp-bottom-sell-plus{ stroke:#0b1120 !important; }
html[data-tp-theme="dark"] .tp-bottom-sell.is-active .tp-bottom-sell-plus{ stroke:#ffffff !important; }

html[data-tp-theme="dark"] :is(.card,.offer-card,.offer-body,.nav-item,.profile-top,.profile-card,.profile-menu-inner,.menu-screen-head,.menu-screen-body,.menu-item,.menu-btn:not(.primary),.avatar-crop-card,.avatar-crop-head,.avatar-crop-body,.order-card,.order-row,.purchase-card,.sale-card,.my-offer-card,.favorite-card,.sell-type-card,.sell-root-loading,.sell-root-empty,.back-btn,.back-pill,.sort-chip,.select,.sell-btn,.home-show-more,.portfolio-remove-btn,.portfolio-add-btn,.lang-rules-box,.lang-rules-toggle,.lang-rules-hint,.cookie-banner,.cookie-btn:not(.primary)){
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(input,select,textarea,.search input,.menu-input,.portfolio-link-input,.price-group input){
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(input,select,textarea)::placeholder{
  color:var(--tp-dark-muted) !important;
  opacity:1 !important;
}

html[data-tp-theme="dark"] :is(.offer-image,.offer-image-empty,.image-preview,.tp-gallery,.avatar,.menu-avatar-wrap,.seller-avatar,.profile-empty-offers-illustration,.empty-state-illustration){
  background:var(--tp-dark-surface-2) !important;
}

html[data-tp-theme="dark"] .offer-image-empty-label{
  background:rgba(148,163,184,.14) !important;
  color:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] :is(.section-title,.home-offers-title,.crumb-game,.crumb-mode,.offer-title,.offer-price,.username,.menu-title,.avatar-crop-title,.empty-state-title,.sell-root-heading,.sell-type-title,label,h1,h2,h3){
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] :is(.catalog-home-subtitle,.empty-state-text,.rating-count,.since,.user-id,.char-counter,.home-note,.home-note-text,.sell-root-subtitle,.sell-type-subtitle,.footer-copy,.cookie-text,.menu-hint,.menu-subhint){
  color:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] .mode-pill:not(.active){
  background:var(--tp-dark-surface-2) !important;
  border-color:var(--tp-dark-line) !important;
  color:#60a5fa !important;
}
html[data-tp-theme="dark"] :is(.mode-pill.active,.sort-chip.active){
  background:#3b82f6 !important;
  border-color:#3b82f6 !important;
  color:#ffffff !important;
}
html[data-tp-theme="dark"] .modes-wrap::after{
  background:linear-gradient(to right, rgba(8,13,25,0), var(--tp-dark-bg) 85%) !important;
}
html[data-tp-theme="dark"] .footer{ background:var(--tp-dark-surface) !important; }
html[data-tp-theme="dark"] .footer-links a{ color:var(--tp-dark-text) !important; }
html[data-tp-theme="dark"] :is(.footer-links a:hover,.footer-links a.active,.cookie-text a){ color:#60a5fa !important; }
html[data-tp-theme="dark"] .profile-menu{ background:rgba(0,0,0,.62) !important; }
html[data-tp-theme="dark"] :is(.menu-back:hover,.menu-close:hover,.nav-item:hover,.menu-item:hover,.menu-btn:hover,.home-show-more:hover,.back-btn:hover){ background:var(--tp-dark-surface-2) !important; }

.tp-page-loader{ background:var(--tp-page-loader-bg, rgba(245,246,248,.98)) !important; }
.tp-page-loader-card{
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
}
.tp-page-loader-mark{ display:none !important; }
.tp-page-loader-text,
.tp-page-loader-logo{
  display:inline-block;
  background:linear-gradient(135deg,#1e3a8a,#2563eb,#3b82f6);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  font-size:34px;
  line-height:1;
  font-weight:950;
  letter-spacing:-.055em;
  animation:tpLoaderLogoPulse .9s ease-in-out infinite;
}
html[data-tp-theme="dark"] .tp-page-loader{ --tp-page-loader-bg:rgba(8,13,25,.98); }
@keyframes tpLoaderLogoPulse{ 0%,100%{transform:scale(1);opacity:.82;} 50%{transform:scale(1.035);opacity:1;} }
@media (prefers-reduced-motion: reduce){ .tp-page-loader-text,.tp-page-loader-logo{ animation:none !important; } }


/* ===== Dark theme final polish: remove leftover light UI surfaces ===== */
html[data-tp-theme="dark"]{
  --tp-dark-bg:#080d19;
  --tp-dark-surface:#101827;
  --tp-dark-surface-2:#172133;
  --tp-dark-surface-3:#202b3d;
  --tp-dark-line:rgba(148,163,184,.24);
  --tp-dark-text:#f8fafc;
  --tp-dark-muted:#9aa7ba;
  --tp-page-bg:var(--tp-dark-bg);
  --tp-panel:var(--tp-dark-surface);
  --tp-panel-bg:var(--tp-dark-surface);
  --tp-bg:var(--tp-dark-bg);
  --tp-text:var(--tp-dark-text);
  --tp-muted:var(--tp-dark-muted);
  --tp-border:var(--tp-dark-line);
  --tp-ui-bg:var(--tp-dark-surface);
  --tp-ui-text:var(--tp-dark-text);
  --tp-ui-border:var(--tp-dark-line);
  --tp-ui-muted:var(--tp-dark-muted);
  --page-bg:var(--tp-dark-bg);
  --card-bg:var(--tp-dark-surface);
  --card:var(--tp-dark-surface);
  --bg:var(--tp-dark-bg);
  --text:var(--tp-dark-text);
  --muted:var(--tp-dark-muted);
  --line:var(--tp-dark-line);
}

html[data-tp-theme="dark"],
html[data-tp-theme="dark"] body,
html[data-tp-theme="dark"] body:not(.offer-create-page),
html[data-tp-theme="dark"] :is(.page-content,.page,.content,.help-shell,.sell-root-sections,.sell-type-view){
  background:var(--tp-dark-bg) !important;
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] :is(.card,.offer-card,.offer-body,.nav-item,.nav-item.is-disabled,.profile-top,.profile-menu-btn,.profile-card,.profile-menu-inner,.menu-screen-head,.menu-screen-body,.menu-item,.menu-toggle,.menu-btn:not(.primary),.menu-btn-secondary,.avatar-crop-card,.avatar-crop-head,.avatar-crop-body,.avatar-crop-close,.order-card,.order-row,.purchase-card,.sale-card,.my-offer-card,.favorite-card,.sell-type-card,.sell-root-loading,.sell-root-empty,.back-btn,.back-pill,.sort-chip,.select,.sell-btn,.home-show-more,.portfolio-remove-btn,.portfolio-add-btn,.lang-rules-box,.lang-rules-toggle,.lang-rules-hint,.cookie-banner,.cookie-btn:not(.primary),.support-menu .menu-btn,.tp-gallery__plus,.tp-gallery__slide){
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] :is(.offer-image,.offer-image-empty,.tp-no-photo,.image-preview,.tp-gallery,.avatar,.menu-avatar-wrap,.seller-avatar,.profile-empty-offers-illustration,.empty-state-illustration,.empty-illustration){
  background:var(--tp-dark-surface-2) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(.offer-image-empty-label,.tp-no-photo__label){
  background:rgba(148,163,184,.12) !important;
  color:var(--tp-dark-muted) !important;
  border-color:rgba(148,163,184,.18) !important;
}

html[data-tp-theme="dark"] .offer-heart{
  background:rgba(31,41,55,.88) !important;
  border-color:rgba(148,163,184,.28) !important;
  box-shadow:0 8px 22px rgba(0,0,0,.28) !important;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}

html[data-tp-theme="dark"] .offer-heart svg{
  stroke:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] .offer-heart.active svg{
  fill:#f87171 !important;
  stroke:#f87171 !important;
}

html[data-tp-theme="dark"] .seller-status{
  border-color:var(--tp-dark-surface) !important;
}

html[data-tp-theme="dark"] :is(h1,h2,h3,.title,.page-title,.section-title,.home-offers-title,.crumb-game,.crumb-mode,.offer-title,.offer-price,.seller-name,.username,.menu-title,.menu-btn-title,.avatar-crop-title,.empty-state-title,.profile-empty-offers-title,.sell-root-heading,.sell-type-title,.sell-type-card-title,.nav-item,label,.avatar-crop-label){
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] :is(.catalog-home-subtitle,.subtitle,.menu-btn-text,.empty-state-text,.empty-text,.profile-empty-offers-text,.rating-count,.since,.user-id,.seller-rating,.seller-rating .reviews-count,.seller-since,.no-reviews,.rating-hidden,.char-counter,.home-note,.home-note-text,.sell-root-subtitle,.sell-type-subtitle,.footer-copy,.cookie-text,.menu-hint,.menu-subhint,.menu-arrow,.tp-gallery__plus,.tp-gallery__plus-icon){
  color:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] :is(input,select,textarea,.search input,.menu-input,.portfolio-link-input,.price-group input){
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(input,select,textarea)::placeholder{
  color:var(--tp-dark-muted) !important;
  opacity:1 !important;
}

html[data-tp-theme="dark"] :is(.nav-item:hover,.menu-item:hover,.menu-btn:hover,.profile-menu-btn:hover,.home-show-more:hover,.back-btn:hover,.sort-chip:hover,.sell-type-card:hover){
  background:var(--tp-dark-surface-2) !important;
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] .nav-item.is-disabled{
  color:rgba(154,167,186,.62) !important;
  background:rgba(17,24,39,.72) !important;
}

html[data-tp-theme="dark"] .footer,
html[data-tp-theme="dark"] #footer-container{
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] .profile-menu.active{
  background:rgba(0,0,0,.72) !important;
}

@media (max-width:640px){
  html[data-tp-theme="dark"] .profile-menu{
    background:var(--tp-dark-bg) !important;
  }
}

/* ===== TyPlace dark theme completion: full pages, chats, support, broken light surfaces ===== */
html[data-tp-theme="dark"]{
  --tp-dark-bg:#080d19;
  --tp-dark-surface:#111827;
  --tp-dark-surface-2:#172133;
  --tp-dark-surface-3:#202b3d;
  --tp-dark-line:rgba(148,163,184,.26);
  --tp-dark-line-soft:rgba(148,163,184,.16);
  --tp-dark-text:#f8fafc;
  --tp-dark-muted:#a4afc2;
  --tp-page-bg:var(--tp-dark-bg);
  --tp-card-bg:var(--tp-dark-surface);
  --tp-panel-bg:var(--tp-dark-surface);
  --tp-border:var(--tp-dark-line);
  --tp-border-soft:var(--tp-dark-line-soft);
  --tp-text:var(--tp-dark-text);
  --tp-muted:var(--tp-dark-muted);
  --bg:var(--tp-dark-bg);
  --card:var(--tp-dark-surface);
  --text:var(--tp-dark-text);
  --muted:var(--tp-dark-muted);
  --line:var(--tp-dark-line);
  --soft:var(--tp-dark-surface-2);
  --tp-system-bg:rgba(22,101,52,.14);
  --tp-system-border:rgba(74,222,128,.24);
  --tp-system-text:#bbf7d0;
  --tp-system-badge-bg:rgba(22,101,52,.24);
  --tp-system-badge-text:#86efac;
  --tp-resolution-bg:rgba(91,33,182,.16);
  --tp-resolution-line:rgba(167,139,250,.26);
  --tp-resolution-text:#ddd6fe;
  --tp-resolution-name:#c4b5fd;
}

html[data-tp-theme="dark"] body,
html[data-tp-theme="dark"] .page-content,
html[data-tp-theme="dark"] .page,
html[data-tp-theme="dark"] .content,
html[data-tp-theme="dark"] .wrap,
html[data-tp-theme="dark"] .container,
html[data-tp-theme="dark"] .help-shell,
html[data-tp-theme="dark"] .support-layout{
  background:var(--tp-dark-bg) !important;
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] :is(
  .panel,
  .chat-section,
  .chat-head,
  .chat-list,
  .chat-item,
  .right-top,
  .messages,
  .composer,
  .chat-menu,
  #offerMiniBlock,
  .form,
  .support-card,
  .support-empty-card,
  .ticket-sidebar,
  .sidebar-card,
  .ticket-card,
  .review-card,
  .review-modal-card,
  .modal-card,
  .message.support,
  .attachment-link,
  .file-link,
  .attach-btn,
  .image-preview,
  .empty-card,
  .empty-state,
  .profile-menu-btn,
  .profile-top,
  .profile-card,
  .profile-menu-inner,
  .menu-screen-head,
  .menu-screen-body,
  .menu-item,
  .menu-toggle,
  .menu-btn:not(.primary),
  .avatar-crop-card,
  .avatar-crop-head,
  .avatar-crop-body,
  .nav-item,
  .card,
  .offer-card,
  .offer-body,
  .my-offer-card,
  .purchase-card,
  .sale-card,
  .order-card,
  .sell-type-card,
  .back-btn,
  .back-pill,
  .sort-chip,
  .select,
  .btn-light,
  .cookie-banner
){
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(.chat-item:hover,.chat-item.active,.chat-item.has-unread,.chat-item.active.has-unread,.menu-item:hover,.file-link:hover,.attach-btn:hover,.nav-item:hover,.sort-chip:hover,.sell-type-card:hover,.profile-menu-btn:hover){
  background:var(--tp-dark-surface-2) !important;
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] :is(input,select,textarea,.input,.select,.textarea,.composer input[type="text"],.menu-input,.portfolio-link-input,.price-group input){
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(input,select,textarea,.input,.select,.textarea)::placeholder{
  color:var(--tp-dark-muted) !important;
  opacity:1 !important;
}

html[data-tp-theme="dark"] :is(.left-title,.right-title .name,.chat-name-line,.chat-ticket-subject,.page-title,.support-empty-title,.profile-title,.profile-header h1,.username,.seller-name,.offer-title,.offer-price,.section-title,.home-offers-title,.sell-type-title,.sell-type-card-title,.menu-title,.menu-btn-title,.review-title,.message.user,.message.support,h1,h2,h3,label,.label){
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] :is(.chat-status-line,.right-title .sub,.empty-right,.left-empty,.empty-messages,.msg-name,.msg-time,.support-empty-text,.support-nav,.support-nav a,.support-nav .current,.textarea-counter,.counter,.char-counter,.file-icon,.file-link-name,.profile-empty-offers-text,.since,.user-id,.rating-count,.seller-rating,.rating-hidden,.no-reviews,.menu-hint,.menu-subhint,.sidebar-label,.ticket-meta,.sub,.subtitle,.muted){
  color:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] .msg.other .msg-body--text,
html[data-tp-theme="dark"] .message.support{
  background:var(--tp-dark-surface-2) !important;
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] .msg.me .msg-body--text,
html[data-tp-theme="dark"] .message.user,
html[data-tp-theme="dark"] .send-btn,
html[data-tp-theme="dark"] .btn:not(.btn-light):not(.menu-btn-secondary){
  background:#2563eb !important;
  color:#ffffff !important;
}

html[data-tp-theme="dark"] .date-divider,
html[data-tp-theme="dark"] .typing-row,
html[data-tp-theme="dark"] .notice{
  color:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] .date-divider::before,
html[data-tp-theme="dark"] .date-divider::after{
  background:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(.chat-ava,.avatar,.seller-avatar,.menu-avatar-wrap,.offer-image,.offer-image-empty,.tp-no-photo,.tp-gallery,.tp-gallery__plus,.profile-empty-offers-illustration,.empty-illustration){
  background:var(--tp-dark-surface-2) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] .status-dot,
html[data-tp-theme="dark"] .seller-status{
  border-color:var(--tp-dark-surface) !important;
}

html[data-tp-theme="dark"] .mini-offer-thumb,
html[data-tp-theme="dark"] .msg-media img,
html[data-tp-theme="dark"] .msg-media video{
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] .composer .mini-btn,
html[data-tp-theme="dark"] .back-btn,
html[data-tp-theme="dark"] .menu-gear,
html[data-tp-theme="dark"] .chat-notify-btn{
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] .menu-item.danger,
html[data-tp-theme="dark"] .file-remove:hover{
  color:#f87171 !important;
}

html[data-tp-theme="dark"] .menu-item.danger:hover{
  background:rgba(248,113,113,.12) !important;
}

html[data-tp-theme="dark"] .tp-offer-id-link,
html[data-tp-theme="dark"] a,
html[data-tp-theme="dark"] .sell-type-card-action,
html[data-tp-theme="dark"] .file-link:hover,
html[data-tp-theme="dark"] .attach-btn:hover{
  color:#60a5fa !important;
}

html[data-tp-theme="dark"] .review-modal,
html[data-tp-theme="dark"] .modal,
html[data-tp-theme="dark"] .profile-menu.active{
  background:rgba(0,0,0,.72) !important;
}

html[data-tp-theme="dark"] .chat-shell,
html[data-tp-theme="dark"] .support-layout,
html[data-tp-theme="dark"] .support-nav{
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] .right-top,
html[data-tp-theme="dark"] .left-top,
html[data-tp-theme="dark"] .composer,
html[data-tp-theme="dark"] .chat-head{
  border-color:var(--tp-dark-line-soft) !important;
}

@media (max-width:640px){
  html[data-tp-theme="dark"] body:has(.chat-shell),
  html[data-tp-theme="dark"] body:has(.chat-shell) .page-content,
  html[data-tp-theme="dark"] body:has(.chat-shell) .wrap{
    background:var(--tp-dark-bg) !important;
  }
}

/* ===== TyPlace final UI bugfix pass: dark mode consistency, danger buttons, docs, offer/create/support ===== */
html[data-tp-theme="dark"]{
  color-scheme:dark;
  --tp-dark-bg:#070c18;
  --tp-dark-surface:#111827;
  --tp-dark-surface-2:#172133;
  --tp-dark-surface-3:#202b3d;
  --tp-dark-line:rgba(148,163,184,.28);
  --tp-dark-line-soft:rgba(148,163,184,.18);
  --tp-dark-text:#f8fafc;
  --tp-dark-muted:#a7b0c0;
  --tp-dark-faint:#717d91;
  --tp-dark-danger:#ef4444;
  --tp-dark-danger-hover:#dc2626;
  --tp-dark-primary:#3b82f6;
  --tp-page-bg:var(--tp-dark-bg);
  --tp-card-bg:var(--tp-dark-surface);
  --tp-panel-bg:var(--tp-dark-surface);
  --tp-border:var(--tp-dark-line);
  --tp-border-soft:var(--tp-dark-line-soft);
  --tp-text:var(--tp-dark-text);
  --tp-muted:var(--tp-dark-muted);
  --page-bg:var(--tp-dark-bg);
  --card-bg:var(--tp-dark-surface);
  --bg:var(--tp-dark-bg);
  --card:var(--tp-dark-surface);
  --text:var(--tp-dark-text);
  --muted:var(--tp-dark-muted);
  --line:var(--tp-dark-line);
  --soft:var(--tp-dark-surface-2);
}

html[data-tp-theme="dark"],
html[data-tp-theme="dark"] body,
html[data-tp-theme="dark"] main,
html[data-tp-theme="dark"] .page-content,
html[data-tp-theme="dark"] .page,
html[data-tp-theme="dark"] .content,
html[data-tp-theme="dark"] .wrap,
html[data-tp-theme="dark"] .container,
html[data-tp-theme="dark"] .help-shell,
html[data-tp-theme="dark"] .support-layout,
html[data-tp-theme="dark"] .sell-root-sections,
html[data-tp-theme="dark"] .sell-type-view{
  background:var(--tp-dark-bg) !important;
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] :is(
  .card, article.card, article.content, .section, .rule-block, .form,
  .panel, .support-card, .support-empty-card, .ticket-card, .ticket-sidebar,
  .sidebar-card, .review-card, .review-modal-card, .modal-card,
  .profile-top, .profile-card, .profile-menu-btn, .profile-menu-inner,
  .menu-screen-head, .menu-screen-body, .menu-item, .menu-toggle,
  .avatar-crop-card, .avatar-crop-head, .avatar-crop-body, .nav-item,
  .offer-page-card, .offer-card, .offer-body, .my-offer-card, .purchase-card,
  .sale-card, .order-card, .sell-type-card, .sell-root-loading, .sell-root-empty,
  .back-btn, .back-pill, .sort-chip, .select, .home-show-more,
  .portfolio-remove-btn, .portfolio-add-btn, .lang-rules-box, .lang-rules-toggle,
  .lang-rules-hint, .cookie-banner, .chat-section, .chat-shell, .left, .right,
  .left-top, .right-top, .chat-head, .chat-list, .chat-item, .messages,
  .composer, .chat-menu, #offerMiniBlock, .attachment-link, .file-link,
  .attach-btn, .empty-card, .empty-state, .support-menu .menu-btn
){
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] :is(
  .rule-block, .chat-item:hover, .chat-item.active, .chat-item.has-unread,
  .chat-item.active.has-unread, .menu-item:hover, .nav-item:hover, .sort-chip:hover,
  .sell-type-card:hover, .profile-menu-btn:hover, .file-link:hover, .attach-btn:hover,
  .portfolio-link:hover, .offer-icon-btn:hover, .offer-page-heart:hover,
  .buy-secondary:hover, .menu-btn:not(.primary):hover, .cookie-btn:not(.primary):hover
){
  background:var(--tp-dark-surface-2) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(
  input, select, textarea, .input, .select, .textarea, .search input,
  .menu-input, .portfolio-link-input, .price-group input, .composer input[type="text"]
){
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(input,select,textarea,.input,.select,.textarea)::placeholder{
  color:var(--tp-dark-muted) !important;
  opacity:1 !important;
}

html[data-tp-theme="dark"] :is(
  h1,h2,h3,h4,label,.label,.title,.page-title,.section-title,.rule-title,
  .support-empty-title,.home-offers-title,.crumb-game,.crumb-mode,.offer-title,
  .offer-page-price,.price,.seller-name,.username,.profile-title,.profile-header h1,
  .menu-title,.menu-btn-title,.avatar-crop-title,.empty-state-title,.sell-type-title,
  .sell-type-card-title,.left-title,.right-title .name,.chat-name-line,.chat-ticket-subject
){
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] :is(
  p,li,.intro,.section-text,.footer-note,.rule-subtitle,.catalog-home-subtitle,
  .subtitle,.sub,.muted,.empty-text,.empty-state-text,.support-empty-text,
  .support-nav,.support-nav a,.support-nav .current,.textarea-counter,.counter,
  .char-counter,.file-icon,.file-link-name,.profile-empty-offers-text,.since,
  .user-id,.rating-count,.seller-rating,.seller-rating .reviews-count,.seller-since,
  .rating-hidden,.no-reviews,.menu-hint,.menu-subhint,.menu-arrow,.sidebar-label,
  .ticket-meta,.chat-status-line,.right-title .sub,.empty-right,.left-empty,
  .empty-messages,.msg-name,.msg-time,.date-divider,.typing-row,.notice,
  .home-note,.home-note-text,.sell-root-subtitle,.sell-type-subtitle,.footer-copy,.cookie-text
){
  color:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] :is(
  .offer-head,.offer-main-meta,.offer-seller,.offer-portfolio-section,.footer-note,
  .date-divider::before,.date-divider::after,.right-top,.left-top,.composer,.chat-head
){
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(
  .offer-icon-btn,.offer-page-heart,.portfolio-link,.buy-secondary,
  .menu-btn:not(.primary),.menu-btn-secondary,.cookie-btn:not(.primary),.avatar-crop-close
){
  background:var(--tp-dark-surface-2) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(.offer-icon-btn svg,.offer-page-heart svg,.portfolio-link-icon svg){
  stroke:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] .offer-page-heart.active,
html[data-tp-theme="dark"] .offer-heart.active{
  color:#f87171 !important;
}

html[data-tp-theme="dark"] .offer-page-heart.active svg,
html[data-tp-theme="dark"] .offer-heart.active svg{
  fill:#f87171 !important;
  stroke:#f87171 !important;
}

html[data-tp-theme="dark"] :is(
  .offer-image,.offer-image-empty,.tp-no-photo,.image-preview,.tp-gallery,
  .tp-gallery__plus,.tp-gallery__slide,.avatar,.seller-avatar,.chat-ava,
  .menu-avatar-wrap,.profile-empty-offers-illustration,.empty-state-illustration,.empty-illustration
){
  background:var(--tp-dark-surface-2) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(.offer-image-empty-label,.tp-no-photo__label,.tp-gallery__plus,.tp-gallery__plus-icon){
  background:rgba(148,163,184,.12) !important;
  color:var(--tp-dark-muted) !important;
  border-color:rgba(148,163,184,.18) !important;
}

/* Primary buttons stay blue, but destructive buttons must stay red in both themes. */
html[data-tp-theme="dark"] :is(.btn-danger,#deleteBtn,.delete-btn,.danger-btn,.menu-item.danger){
  background:var(--tp-dark-danger) !important;
  border-color:var(--tp-dark-danger) !important;
  color:#ffffff !important;
}

html[data-tp-theme="dark"] :is(.btn-danger,#deleteBtn,.delete-btn,.danger-btn):hover{
  background:var(--tp-dark-danger-hover) !important;
  border-color:var(--tp-dark-danger-hover) !important;
  box-shadow:0 10px 26px rgba(239,68,68,.22) !important;
}

html[data-tp-theme="dark"] :is(.send-btn,.btn:not(.btn-light):not(.btn-danger):not(.menu-btn-secondary),.buy-primary,.submit-btn,.primary,.cookie-btn.primary){
  background:#2563eb !important;
  border-color:#2563eb !important;
  color:#ffffff !important;
}

html[data-tp-theme="dark"] .msg.other .msg-body--text,
html[data-tp-theme="dark"] .message.support{
  background:var(--tp-dark-surface-2) !important;
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] .msg.me .msg-body--text,
html[data-tp-theme="dark"] .message.user{
  background:#2563eb !important;
  color:#ffffff !important;
}

html[data-tp-theme="dark"] :is(.doc-link,a.doc-link,.tp-offer-id-link,.sell-type-card-action,.portfolio-link-text){
  color:#60a5fa !important;
}

html[data-tp-theme="dark"] :is(.review-modal,.modal,.profile-menu.active){
  background:rgba(0,0,0,.72) !important;
}

html[data-tp-theme="dark"] .footer,
html[data-tp-theme="dark"] #footer-container{
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] .footer-links a{
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] .footer-links a:hover{
  color:#60a5fa !important;
}

html[data-tp-theme="dark"] .status-dot,
html[data-tp-theme="dark"] .seller-status{
  border-color:var(--tp-dark-surface) !important;
}

html[data-tp-theme="dark"] .mode-pill:not(.active){
  background:var(--tp-dark-surface-2) !important;
  border-color:var(--tp-dark-line) !important;
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] :is(.mode-pill.active,.sort-chip.active){
  background:#3b82f6 !important;
  border-color:#3b82f6 !important;
  color:#ffffff !important;
}

/* Mobile form pages should keep full width and enough bottom space under the floating nav/browser bar. */
@media (max-width:768px){
  body.offer-create-page .page,
  body:has(#supportCreateForm) .page,
  body:has(#ticketForm) .page{
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
    padding-left:16px !important;
    padding-right:16px !important;
    padding-bottom:calc(190px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.offer-create-page .container,
  body:has(#supportCreateForm) .container,
  body:has(#ticketForm) .container{
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
    padding-left:0 !important;
    padding-right:0 !important;
  }

  body.offer-create-page .card,
  body:has(#supportCreateForm) .form,
  body:has(#ticketForm) .form{
    width:100% !important;
    max-width:none !important;
  }
}

/* ===== FINAL UI CLEANUP: dark mode, footer, catalog search, dangerous actions ===== */
:root{
  --tp-mobile-safe-bottom: calc(190px + env(safe-area-inset-bottom, 0px));
}

:is(.btn-danger,#deleteBtn,.delete-btn,.danger-btn,.logout-item,.menu-item.logout-item,.menu-btn.danger,.menu-btn-danger,.confirm-danger){
  color:#ffffff !important;
  background:#ef4444 !important;
  border-color:#ef4444 !important;
}

:is(.btn-danger,#deleteBtn,.delete-btn,.danger-btn,.logout-item,.menu-item.logout-item,.menu-btn.danger,.menu-btn-danger,.confirm-danger):hover{
  color:#ffffff !important;
  background:#dc2626 !important;
  border-color:#dc2626 !important;
}

.menu-item.logout-item{
  justify-content:flex-start !important;
}

.sort-chip.active,
#filterToggle.active,
button.sort-chip.active{
  background:#3b82f6 !important;
  border-color:#3b82f6 !important;
  color:#ffffff !important;
}

.sort-chip.active svg,
#filterToggle.active svg,
.sort-chip.active .filter-icon{
  stroke:#ffffff !important;
  color:#ffffff !important;
}

#footer-container{
  width:100%;
  flex-shrink:0;
}

.footer{
  box-sizing:border-box;
}

@media (max-width:768px){
  .footer{
    padding-bottom:var(--tp-mobile-safe-bottom) !important;
  }

  body:not(.offer-create-page) .page-content{
    padding-bottom:calc(40px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

html[data-tp-theme="dark"]{
  --tp-dark-bg:#080d19;
  --tp-dark-surface:#111827;
  --tp-dark-surface-2:#172133;
  --tp-dark-surface-3:#1f2937;
  --tp-dark-line:rgba(148,163,184,.28);
  --tp-dark-text:#f8fafc;
  --tp-dark-muted:#aeb8ca;
  --tp-dark-faint:#7b879b;
}

html[data-tp-theme="dark"] body{
  background:var(--tp-dark-bg) !important;
  color:var(--tp-dark-text) !important;
}

/* Layout wrappers stay transparent. This removes the fake outer boxes. */
html[data-tp-theme="dark"] :is(main,.page-content,.page,.container,.wrap,.content,.sell-root-sections,.sell-type-view){
  background:transparent !important;
  box-shadow:none !important;
}

/* Real cards/panels stay dark, not white. */
html[data-tp-theme="dark"] :is(
  article.card, article.content, .card:not(.catalog-home-card), .note, .rule-block,
  .support-card, .support-empty-card, .ticket-card, .ticket-sidebar, .sidebar-card,
  .profile-top, .profile-card, .profile-menu-inner, .menu-screen-head, .menu-screen-body,
  .menu-toggle, .avatar-crop-card, .avatar-crop-head, .avatar-crop-body,
  .offer-card, .offer-page-card, .offer-body, .my-offer-card, .purchase-card, .sale-card, .order-card,
  .sell-type-card, .review-card, .review-modal-card, .modal-card, .cookie-banner,
  .chat-shell, .left, .right, .left-top, .right-top, .chat-head, .chat-list, .chat-item,
  .messages, .composer, .chat-menu, .attachment-link, .file-link, .attach-btn
){
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
  box-shadow:none !important;
}

/* Empty states should not look like a separate rectangular shell. */
html[data-tp-theme="dark"] :is(.empty-state,.empty-state-inner,.profile-empty-offers,.profile-empty-offers-inner){
  background:transparent !important;
  border-color:transparent !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] :is(.empty-illustration,.empty-state-illustration,.profile-empty-offers-illustration){
  background:transparent !important;
  border-color:transparent !important;
}

/* Header/search icons and select arrows must be visible in dark mode. */
html[data-tp-theme="dark"] :is(.tp-search-icon,.tp-mobile-search-icon,.tp-clear svg,.tp-burger-caret,.filter-icon,.home-note-icon svg,.portfolio-link-icon svg){
  stroke:var(--tp-dark-muted) !important;
  color:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] :is(.tp-burger-svg,.tp-mobile-burger svg,.tp-bottom-item svg){
  color:var(--tp-dark-muted) !important;
  stroke:currentColor !important;
}

html[data-tp-theme="dark"] :is(select,.select){
  color-scheme:dark;
  background-color:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(input,textarea,select,.input,.textarea,.select,.menu-input,.portfolio-link-input,.price-group input,.composer input[type="text"]){
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(input,textarea,select,.input,.textarea,.select)::placeholder{
  color:var(--tp-dark-muted) !important;
  opacity:1 !important;
}

/* Category/subcategory labels are normal text, not blue accents. */
html[data-tp-theme="dark"] :is(.catalog-home-title,.sell-subcategory-title,.crumb-game,.crumb-mode,.mode-title,.service-title){
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] :is(.catalog-home-subtitle,.sell-type-subtitle,.muted,.subtitle,.sub,.meta,.section-text,.content p,.content li,.note,.footer-note,.empty-text,.empty-state-text,.profile-empty-offers-text,.since,.user-id,.rating-count,.seller-rating,.seller-since,.char-counter,.counter,.textarea-counter,.home-note,.home-note-text,.menu-hint,.menu-subhint,.support-nav,.ticket-meta){
  color:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] :is(h1,h2,h3,h4,label,.label,.title,.page-title,.section-title,.section-title span,.content h1,.content h2,.content b,.card h1,.card h2,.rule-title,.support-empty-title,.home-offers-title,.offer-title,.offer-page-price,.offer-price,.price,.seller-name,.username,.profile-title,.menu-title,.menu-btn-title,.empty-state-title,.sell-type-title,.sell-type-card-title,.left-title,.right-title .name,.chat-name-line,.chat-ticket-subject){
  color:var(--tp-dark-text) !important;
}

/* Dark action buttons: only active/primary are blue; normal controls are dark. */
html[data-tp-theme="dark"] :is(.back-btn,.back-pill,.sort-chip:not(.active),.home-show-more,.portfolio-remove-btn,.portfolio-add-btn,.offer-icon-btn,.offer-page-heart,.portfolio-link,.buy-secondary,.menu-btn:not(.primary):not(.danger):not(.menu-btn-danger),.cookie-btn:not(.primary)){
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
  border-color:var(--tp-dark-line) !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] :is(.back-btn:hover,.back-pill:hover,.sort-chip:not(.active):hover,.home-show-more:hover,.portfolio-remove-btn:hover,.portfolio-add-btn:hover,.offer-icon-btn:hover,.offer-page-heart:hover,.portfolio-link:hover,.buy-secondary:hover,.menu-btn:not(.primary):not(.danger):not(.menu-btn-danger):hover,.cookie-btn:not(.primary):hover){
  background:var(--tp-dark-surface-2) !important;
}

html[data-tp-theme="dark"] :is(.btn-danger,#deleteBtn,.delete-btn,.danger-btn,.logout-item,.menu-item.logout-item,.menu-btn.danger,.menu-btn-danger,.confirm-danger){
  color:#ffffff !important;
  background:#ef4444 !important;
  border-color:#ef4444 !important;
}

html[data-tp-theme="dark"] :is(.btn-danger,#deleteBtn,.delete-btn,.danger-btn,.logout-item,.menu-item.logout-item,.menu-btn.danger,.menu-btn-danger,.confirm-danger):hover{
  background:#dc2626 !important;
  border-color:#dc2626 !important;
}

html[data-tp-theme="dark"] :is(.sort-chip.active,#filterToggle.active,.mode-pill.active,.cookie-btn.primary,.btn:not(.btn-light):not(.btn-danger):not(.menu-btn-secondary):not(.logout-item),.buy-primary,.submit-btn,.primary,.send-btn){
  background:#3b82f6 !important;
  border-color:#3b82f6 !important;
  color:#ffffff !important;
}

html[data-tp-theme="dark"] :is(.sort-chip.active,#filterToggle.active) svg{
  stroke:#ffffff !important;
  color:#ffffff !important;
}

html[data-tp-theme="dark"] :is(.offer-main-meta,.offer-seller,.offer-portfolio-section,.right-top,.left-top,.composer,.chat-head){
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(.offer-icon-btn svg,.offer-page-heart svg){
  stroke:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] :is(.offer-page-heart.active,.offer-heart.active){
  color:#f87171 !important;
}

html[data-tp-theme="dark"] :is(.offer-page-heart.active svg,.offer-heart.active svg){
  fill:#f87171 !important;
  stroke:#f87171 !important;
}

html[data-tp-theme="dark"] :is(.offer-image-empty-label,.tp-no-photo__label,.tp-gallery__plus,.tp-gallery__plus-icon){
  color:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] :is(.msg.other .msg-body--text,.message.support){
  background:var(--tp-dark-surface-2) !important;
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] :is(.msg.me .msg-body--text,.message.user){
  background:#2563eb !important;
  color:#ffffff !important;
}

html[data-tp-theme="dark"] :is(article.content,.card,.note){
  background:var(--tp-dark-surface) !important;
  border-color:var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] :is(.note,.content p,.content li,.card p,.card li,.section-text){
  color:var(--tp-dark-muted) !important;
}

html[data-tp-theme="dark"] :is(.doc-link,.email,.help-link,.portfolio-link-text,.tp-offer-id-link){
  color:#60a5fa !important;
}

/* Footer dark mode is a consistent surface, not pure black. */
html[data-tp-theme="dark"] #footer-container{
  background:var(--tp-dark-bg) !important;
}

html[data-tp-theme="dark"] .footer{
  background:var(--tp-dark-surface) !important;
  color:var(--tp-dark-text) !important;
  border-top:1px solid var(--tp-dark-line) !important;
}

html[data-tp-theme="dark"] .footer-links a{
  color:var(--tp-dark-text) !important;
}

html[data-tp-theme="dark"] :is(.footer-links a:hover,.footer-links a.active,.cookie-text a){
  color:#60a5fa !important;
}

html[data-tp-theme="dark"] .footer-copy{
  color:var(--tp-dark-muted) !important;
}

@media (max-width:768px){
  html[data-tp-theme="dark"] body:not(.offer-create-page) .page-content{
    min-height:calc(100svh - 96px) !important;
  }

  html[data-tp-theme="dark"] body:has(#supportCreateForm) .page-content,
  html[data-tp-theme="dark"] body:has(#ticketForm) .page-content{
    padding-top:120px !important;
  }

  html[data-tp-theme="dark"] body:has(#supportCreateForm) .container,
  html[data-tp-theme="dark"] body:has(#ticketForm) .container,
  html[data-tp-theme="dark"] body.offer-create-page .container{
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
    padding-left:16px !important;
    padding-right:16px !important;
  }

  html[data-tp-theme="dark"] body:has(#supportCreateForm) .form,
  html[data-tp-theme="dark"] body:has(#ticketForm) .form{
    width:100% !important;
    max-width:none !important;
  }

  html[data-tp-theme="dark"] body:has(#supportCreateForm) .page,
  html[data-tp-theme="dark"] body:has(#ticketForm) .page,
  html[data-tp-theme="dark"] body.offer-create-page .page{
    padding-bottom:calc(210px + env(safe-area-inset-bottom, 0px)) !important;
  }

  html[data-tp-theme="dark"] .footer{
    padding-bottom:var(--tp-mobile-safe-bottom) !important;
  }
}

/* Contacts and legal pages must never crop content. */
body:has(a[href="mailto:legal@typlace.com"]) :is(.page-content,.page,.card),
body:has(.doc-link) :is(.page-content,.page,article.content,.card){
  overflow:visible !important;
}

body:has(a[href="mailto:legal@typlace.com"]) .page,
body:has(.doc-link) .page{
  padding-bottom:calc(170px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ===== TyPlace final fix: mobile search, adaptive page height, bottom nav, dark empty shells ===== */

/* Base document layout: pages have a full-screen minimum, but grow with content. */
html{
  min-height:100%;
  height:auto;
}

body{
  min-height:100svh;
  height:auto;
  overflow-x:hidden;
}

.page-content{
  flex:1 0 auto;
  min-height:calc(100svh - 76px);
  height:auto;
  max-height:none;
}

/* Ordinary pages must not crop long content. Chat keeps its own fixed internal layout. */
body:not(:has(.chat-shell)) :is(.page-content,.page,.wrap,.container,article.content,article.card,.section){
  max-height:none !important;
}

body:not(:has(.chat-shell)) :is(.page-content,.page,article.content,article.card,.section){
  overflow:visible !important;
}

@media (max-width:768px){
  body:not(.offer-create-page):not(:has(.chat-shell)){
    padding-bottom:calc(var(--bottom-nav-h) + 22px + env(safe-area-inset-bottom, 0px));
  }

  body:not(.offer-create-page):not(:has(.chat-shell)) .page-content{
    min-height:calc(100svh - 76px);
  }

  body.offer-create-page{
    min-height:100svh !important;
    height:auto !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    padding-top:0 !important;
    padding-bottom:0 !important;
  }

  body.offer-create-page :is(.page-content,.page,.container){
    height:auto !important;
    max-height:none !important;
  }

  body.offer-create-page :is(.page-content,.page){
    overflow:visible !important;
  }

  body.offer-create-page .page{
    padding-bottom:calc(140px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Mobile search icon: in dark mode it must match the placeholder, not turn black. */
html[data-tp-theme="dark"] :is(.tp-search-icon,.tp-mobile-search-icon,.tp-clear svg),
html[data-tp-theme="dark"] :is(.tp-search-icon,.tp-mobile-search-icon,.tp-clear svg) :is(circle,line,path){
  color:var(--tp-dark-muted, #aeb8ca) !important;
  stroke:var(--tp-dark-muted, #aeb8ca) !important;
  fill:none !important;
}

html[data-tp-theme="dark"] .tp-mobile-search input::placeholder{
  color:var(--tp-dark-muted, #aeb8ca) !important;
  opacity:1 !important;
}

/* Bottom mobile nav: all cells and SVG icons use one size and one baseline. */
@media (max-width:768px){
  .tp-bottom-mobile{
    justify-content:stretch !important;
  }

  .tp-bottom-item{
    flex:1 1 0 !important;
    min-width:0 !important;
    height:100% !important;
    padding:6px 4px !important;
    line-height:1 !important;
  }

  .tp-bottom-item svg,
  .tp-bottom-chat-icon-wrap,
  .tp-bottom-sell .tp-bottom-sell-svg{
    width:22px !important;
    height:22px !important;
    min-width:22px !important;
    min-height:22px !important;
  }
}

/* Sell icon: filled circle with a real transparent/cut-out plus. */
.tp-bottom-sell .tp-bottom-sell-svg{
  display:block;
  flex-shrink:0;
  fill:none !important;
}

.tp-bottom-sell .tp-bottom-sell-circle{
  fill:currentColor !important;
  stroke:none !important;
}

.tp-bottom-sell.is-active{
  color:var(--accent);
}

.tp-bottom-sell.is-active .tp-bottom-sell-circle{
  fill:var(--accent) !important;
  stroke:none !important;
}

/* Dark theme: empty SVG illustrations should not receive a fake gray rectangular shell. */
html[data-tp-theme="dark"] :is(
  .empty-state,
  .empty-state-inner,
  .empty-card,
  .profile-empty-offers,
  .profile-empty-offers-inner,
  .support-empty,
  .support-empty-inner
){
  background:transparent !important;
  border-color:transparent !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] :is(
  .empty-illustration,
  .empty-state-illustration,
  .profile-empty-offers-illustration,
  .support-empty-illustration
){
  background:transparent !important;
  border-color:transparent !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] :is(
  .empty-illustration svg,
  .empty-state-illustration svg,
  .profile-empty-offers-illustration svg,
  .support-empty-illustration svg
){
  background:transparent !important;
}

/* Dark theme: remove the small gray square around the add-photo plus.
   The upload area itself stays dark; only the icon shell is removed. */
html[data-tp-theme="dark"] .tp-gallery__plus{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] .tp-gallery__plus-icon{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  width:auto !important;
  height:auto !important;
  padding:0 !important;
  color:var(--tp-dark-muted, #aeb8ca) !important;
}

/* Footer and bottom nav should not cover the last content on mobile legal/category pages. */
@media (max-width:768px){
  body:not(.offer-create-page):not(:has(.chat-shell)) .footer{
    padding-bottom:calc(var(--bottom-nav-h) + 120px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body:not(.offer-create-page):not(:has(.chat-shell)) :is(.page,.content,article.content,.section){
    scroll-margin-bottom:calc(var(--bottom-nav-h) + 60px + env(safe-area-inset-bottom, 0px));
  }
}

/* ===== FINAL POLISH FIX: mobile search icon + dark shells + readable offer text ===== */
html[data-tp-theme="dark"] .tp-mobile-search,
html[data-tp-theme="dark"] .tp-search{
  color:var(--tp-dark-muted, #aeb8ca) !important;
}
html[data-tp-theme="dark"] .tp-mobile-search .tp-mobile-search-icon,
html[data-tp-theme="dark"] .tp-mobile-search .tp-mobile-search-icon *,
html[data-tp-theme="dark"] .tp-search .tp-search-icon,
html[data-tp-theme="dark"] .tp-search .tp-search-icon *{
  color:var(--tp-dark-muted, #aeb8ca) !important;
  stroke:var(--tp-dark-muted, #aeb8ca) !important;
  fill:none !important;
  opacity:1 !important;
}
html[data-tp-theme="dark"] body.offer-create-page :is(.card),
html[data-tp-theme="dark"] body:has(#supportForm) :is(.form),
html[data-tp-theme="dark"] body:has(#supportEmpty) :is(.support-empty,.support-empty.show,.support-empty-inner),
html[data-tp-theme="dark"] body:has(#emptyState) :is(.empty-state,.empty-state.show,.empty-inner),
html[data-tp-theme="dark"] body:has(#empty) :is(.empty-state,.empty-state.show),
html[data-tp-theme="dark"] :is(.profile-empty-offers,.profile-empty-offers-inner){
  background:transparent !important;
  border-color:transparent !important;
  box-shadow:none !important;
}
html[data-tp-theme="dark"] :is(.empty-illustration,.empty-state-illustration,.support-empty-illustration,.profile-empty-offers-illustration,.empty-illustration svg,.empty-state-illustration svg,.support-empty-illustration svg,.profile-empty-offers-illustration svg){
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}
html[data-tp-theme="dark"] body.offer-create-page :is(.tp-gallery__plus,.tp-gallery__plus-icon),
html[data-tp-theme="dark"] :is(.tp-gallery__plus-icon){
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}
html[data-tp-theme="dark"] body.offer-create-page .tp-gallery__plus-icon{
  width:auto !important;
  height:auto !important;
  min-width:0 !important;
  min-height:0 !important;
  padding:0 !important;
  display:block !important;
  color:var(--tp-dark-muted, #aeb8ca) !important;
}
html[data-tp-theme="dark"] :is(#desc,.desc,.offer-desc-section .desc){
  color:var(--tp-dark-text, #f8fafc) !important;
  opacity:1 !important;
}
html[data-tp-theme="dark"] :is(.offer-desc-section .section-title){
  color:var(--tp-dark-text, #f8fafc) !important;
}
html[data-tp-theme="dark"] :is(.buy-secondary,.buybtn.buy-secondary){
  background:var(--tp-dark-surface, #111827) !important;
  color:#60a5fa !important;
  border-color:#3b82f6 !important;
  box-shadow:none !important;
}
html[data-tp-theme="dark"] :is(.buy-secondary,.buybtn.buy-secondary):hover{
  background:var(--tp-dark-surface-2, #172133) !important;
}
@media (max-width:768px){
  body:not(.offer-create-page):not(:has(.chat-shell)) :is(.page,.container,main,.page-content){
    max-height:none !important;
    overflow:visible !important;
  }
  body:not(.offer-create-page):not(:has(.chat-shell)) .page{
    padding-bottom:calc(var(--bottom-nav-h) + 150px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body:not(.offer-create-page):not(:has(.chat-shell)) .footer{
    padding-bottom:calc(var(--bottom-nav-h) + 140px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.offer-create-page .page{
    padding-bottom:calc(150px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ===== HOTFIX 2026-05-01: mobile search icon, offer-create dark shell, rules red labels ===== */

/* Mobile dark search: the SVG was being covered by the input on some mobile browsers.
   Use a CSS magnifier only in dark mode so the icon is always visible. */
@media (max-width:768px){
  .tp-mobile-search{
    position:relative !important;
  }

  .tp-mobile-search input{
    position:relative !important;
    z-index:1 !important;
  }

  .tp-mobile-search-icon{
    z-index:3 !important;
    pointer-events:none !important;
  }

  html[data-tp-theme="dark"] .tp-mobile-search .tp-mobile-search-icon{
    display:none !important;
  }

  html[data-tp-theme="dark"] .tp-mobile-search::before{
    content:"";
    position:absolute;
    left:12px;
    top:50%;
    width:13px;
    height:13px;
    border:2px solid var(--tp-dark-muted, #aeb8ca);
    border-radius:999px;
    transform:translateY(-58%);
    z-index:3;
    pointer-events:none;
    box-sizing:border-box;
  }

  html[data-tp-theme="dark"] .tp-mobile-search::after{
    content:"";
    position:absolute;
    left:24px;
    top:50%;
    width:8px;
    height:2px;
    background:var(--tp-dark-muted, #aeb8ca);
    border-radius:999px;
    transform:translateY(4px) rotate(45deg);
    transform-origin:left center;
    z-index:3;
    pointer-events:none;
  }
}

/* Offer create: remove only the fake dark rectangular wrapper around the form.
   Inputs/selects/textareas keep their own dark backgrounds and borders. */
html[data-tp-theme="dark"] body.offer-create-page .card,
html[data-tp-theme="dark"] body.offer-create-page #offerForm > .card,
html[data-tp-theme="dark"] body.offer-create-page :is(.card,.form-card,.create-card,.offer-create-card){
  background:transparent !important;
  border-color:transparent !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] body.offer-create-page :is(input,select,textarea,.portfolio-link-input,.price-group input){
  background:var(--tp-dark-surface, #111827) !important;
  color:var(--tp-dark-text, #f8fafc) !important;
  border-color:var(--tp-dark-line, rgba(148,163,184,.28)) !important;
}

/* Keep the real gallery/upload area dark, but remove the little square around the plus itself. */
html[data-tp-theme="dark"] body.offer-create-page .tp-gallery{
  background:var(--tp-dark-surface-2, #172133) !important;
  border-color:transparent !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] body.offer-create-page .tp-gallery__plus,
html[data-tp-theme="dark"] body.offer-create-page .tp-gallery__plus-icon{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] body.offer-create-page .tp-gallery__plus-icon{
  width:auto !important;
  height:auto !important;
  min-width:0 !important;
  min-height:0 !important;
  padding:0 !important;
  line-height:1 !important;
  color:var(--tp-dark-muted, #aeb8ca) !important;
}

/* Rules page: warning/measure labels must stay red in dark mode, not become white. */
html[data-tp-theme="dark"] .rule-subtitle.measure,
html[data-tp-theme="dark"] [data-i18n="page.labels.measure"]{
  color:#ef4444 !important;
}

/* ===== FINAL CLEANUP 2: keep original search SVG, remove no-photo chip, compact offer-create, dark edit button ===== */

/* Mobile search: use the real SVG icon on both themes. Do not replace it with a CSS pseudo icon. */
@media (max-width:768px){
  .tp-mobile-search::before,
  .tp-mobile-search::after{
    content:none !important;
    display:none !important;
  }

  .tp-mobile-search .tp-mobile-search-icon{
    display:block !important;
    position:absolute !important;
    left:10px !important;
    top:50% !important;
    width:16px !important;
    height:16px !important;
    min-width:16px !important;
    min-height:16px !important;
    transform:translateY(-50%) !important;
    z-index:3 !important;
    pointer-events:none !important;
    color:#666 !important;
    stroke:#666 !important;
    fill:none !important;
    stroke-width:2 !important;
    opacity:1 !important;
  }

  .tp-mobile-search .tp-mobile-search-icon *{
    stroke:currentColor !important;
    fill:none !important;
    stroke-width:2 !important;
  }

  html[data-tp-theme="dark"] .tp-mobile-search .tp-mobile-search-icon{
    color:var(--tp-dark-muted, #aeb8ca) !important;
    stroke:var(--tp-dark-muted, #aeb8ca) !important;
  }
}

/* Offer-create: remove the remaining form wrapper/shell in dark mode and remove extra bottom air. */
html[data-tp-theme="dark"] body.offer-create-page :is(.container,#offerForm,#offerForm > .card,.card,.form-card,.create-card,.offer-create-card){
  background:transparent !important;
  border-color:transparent !important;
  box-shadow:none !important;
}

@media (max-width:768px){
  body.offer-create-page,
  body.offer-create-page .page-content,
  body.offer-create-page .page,
  body.offer-create-page .container,
  body.offer-create-page #offerForm{
    min-height:0 !important;
    height:auto !important;
    max-height:none !important;
    overflow:visible !important;
  }

  body.offer-create-page .page{
    padding-bottom:max(18px, env(safe-area-inset-bottom, 0px)) !important;
  }

  body.offer-create-page .container,
  body.offer-create-page #offerForm,
  body.offer-create-page #offerForm > .card{
    padding-bottom:0 !important;
    margin-bottom:0 !important;
  }

  body.offer-create-page #submitBtn,
  body.offer-create-page #deleteBtn{
    margin-bottom:0 !important;
  }
}

/* No-photo label: keep only text, never a little rectangle behind it. */
html[data-tp-theme="dark"] :is(.tp-no-photo__label,.offer-image-empty-label){
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  padding:0 !important;
  border-radius:0 !important;
  color:var(--tp-dark-muted, #aeb8ca) !important;
}

/* Offer page: dark secondary/edit button so it does not flash as a white block. */
html[data-tp-theme="dark"] body :is(.buybtn.buy-secondary,.buy-secondary){
  background:rgba(15,23,42,.72) !important;
  color:#79adff !important;
  border-color:rgba(96,165,250,.8) !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] body :is(.buybtn.buy-secondary,.buy-secondary):hover{
  background:rgba(30,41,59,.86) !important;
  color:#93c5fd !important;
}

/* Rules page: red measure labels must stay red in dark mode. */
html[data-tp-theme="dark"] body .rule-subtitle.measure,
html[data-tp-theme="dark"] body [data-i18n="page.labels.measure"].rule-subtitle,
html[data-tp-theme="dark"] body [data-i18n="page.labels.measure"]{
  color:#ef4444 !important;
}

/* ===== FINAL MOBILE CLEANUP 2026-05-01: exact remaining fixes ===== */

/* Mobile search icon: keep the original SVG shape, only recolor it in dark theme. */
@media (max-width:768px){
  .tp-mobile-search::before,
  .tp-mobile-search::after{
    content:none !important;
    display:none !important;
  }

  body .tp-header-mobile .tp-mobile-search svg.tp-mobile-search-icon{
    display:block !important;
    position:absolute !important;
    left:10px !important;
    top:50% !important;
    width:16px !important;
    height:16px !important;
    min-width:16px !important;
    min-height:16px !important;
    transform:translateY(-50%) !important;
    z-index:5 !important;
    pointer-events:none !important;
    fill:none !important;
    opacity:1 !important;
    color:#7b7b7c !important;
    stroke:#7b7b7c !important;
  }

  body .tp-header-mobile .tp-mobile-search svg.tp-mobile-search-icon circle,
  body .tp-header-mobile .tp-mobile-search svg.tp-mobile-search-icon line,
  body .tp-header-mobile .tp-mobile-search svg.tp-mobile-search-icon path{
    fill:none !important;
    stroke:currentColor !important;
    stroke-width:2 !important;
    stroke-linecap:round !important;
  }

  html[data-tp-theme="dark"] body .tp-header-mobile .tp-mobile-search input::placeholder{
    color:var(--tp-dark-muted, #aeb8ca) !important;
    opacity:1 !important;
  }

  html[data-tp-theme="dark"] body .tp-header-mobile .tp-mobile-search svg.tp-mobile-search-icon{
    color:var(--tp-dark-muted, #aeb8ca) !important;
    stroke:var(--tp-dark-muted, #aeb8ca) !important;
  }
}

/* Bottom nav active item in dark theme: active icon/text must be blue, not muted gray. */
@media (max-width:768px){
  html[data-tp-theme="dark"] body .tp-bottom-mobile .tp-bottom-item.is-active{
    color:#60a5fa !important;
    background:rgba(59,130,246,.18) !important;
  }

  html[data-tp-theme="dark"] body .tp-bottom-mobile .tp-bottom-item.is-active svg,
  html[data-tp-theme="dark"] body .tp-bottom-mobile .tp-bottom-item.is-active svg *{
    color:#60a5fa !important;
    fill:currentColor !important;
    stroke:currentColor !important;
  }

  html[data-tp-theme="dark"] body .tp-bottom-mobile .tp-bottom-sell.is-active .tp-bottom-sell-circle{
    fill:#60a5fa !important;
    stroke:none !important;
  }
}

/* Offer-create: high-specificity override for old mobile dark bottom padding. */
@media (max-width:768px){
  html[data-tp-theme="dark"] body.offer-create-page,
  html[data-tp-theme="dark"] body.offer-create-page .page-content,
  html[data-tp-theme="dark"] body.offer-create-page .page,
  html[data-tp-theme="dark"] body.offer-create-page .container,
  html[data-tp-theme="dark"] body.offer-create-page #offerForm{
    min-height:0 !important;
    height:auto !important;
    max-height:none !important;
    overflow:visible !important;
  }

  html[data-tp-theme="dark"] body.offer-create-page .page{
    padding-bottom:max(10px, env(safe-area-inset-bottom, 0px)) !important;
  }

  html[data-tp-theme="dark"] body.offer-create-page .container,
  html[data-tp-theme="dark"] body.offer-create-page #offerForm,
  html[data-tp-theme="dark"] body.offer-create-page #offerForm > .card{
    margin-bottom:0 !important;
    padding-bottom:0 !important;
  }

  html[data-tp-theme="dark"] body.offer-create-page #submitBtn,
  html[data-tp-theme="dark"] body.offer-create-page #deleteBtn{
    margin-bottom:0 !important;
  }
}

/* Offer page edit button: softer dark theme, not a bright white block. */
html[data-tp-theme="dark"] body :is(.buybtn.buy-secondary,.buy-secondary){
  background:rgba(30,41,59,.72) !important;
  color:#93c5fd !important;
  border-color:rgba(96,165,250,.42) !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] body :is(.buybtn.buy-secondary,.buy-secondary):hover{
  background:rgba(30,41,59,.88) !important;
  color:#bfdbfe !important;
  border-color:rgba(96,165,250,.58) !important;
}

/* No-photo text: remove only the small label chip, keep the dark image placeholder itself. */
html[data-tp-theme="dark"] body :is(.tp-no-photo__label,.offer-image-empty-label){
  display:inline !important;
  min-height:0 !important;
  padding:0 !important;
  margin:0 !important;
  background:transparent !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  color:var(--tp-dark-muted, #aeb8ca) !important;
}

/* Chats mobile dark theme: remove the big rectangular shell behind the list. */
@media (max-width:640px){
  html[data-tp-theme="dark"] body:has(.chat-shell) .wrap,
  html[data-tp-theme="dark"] body:has(.chat-shell) .chat-shell,
  html[data-tp-theme="dark"] body:has(.chat-shell) .left,
  html[data-tp-theme="dark"] body:has(.chat-shell) .chat-list{
    background:transparent !important;
    border-color:transparent !important;
    box-shadow:none !important;
  }

  html[data-tp-theme="dark"] body:has(.chat-shell) .left-top{
    background:transparent !important;
    border-color:var(--tp-dark-line, rgba(148,163,184,.28)) !important;
  }

  html[data-tp-theme="dark"] body:has(.chat-shell) .chat-item{
    background:transparent !important;
    border-color:var(--tp-dark-line, rgba(148,163,184,.28)) !important;
  }

  html[data-tp-theme="dark"] body:has(.chat-shell) .chat-item:hover,
  html[data-tp-theme="dark"] body:has(.chat-shell) .chat-item.active,
  html[data-tp-theme="dark"] body:has(.chat-shell) .chat-item.has-unread{
    background:rgba(59,130,246,.10) !important;
  }
}

/* ===== FINAL OFFER/POLISH OVERRIDES 2026-05-01 ===== */

@media (max-width:768px){
  body .tp-header-mobile .tp-mobile-search::before,
  body .tp-header-mobile .tp-mobile-search::after{
    content:none !important;
    display:none !important;
  }

  body .tp-header-mobile .tp-mobile-search svg.tp-mobile-search-icon{
    display:block !important;
    position:absolute !important;
    left:10px !important;
    top:50% !important;
    width:16px !important;
    height:16px !important;
    min-width:16px !important;
    min-height:16px !important;
    transform:translateY(-50%) !important;
    z-index:10 !important;
    pointer-events:none !important;
    opacity:1 !important;
    fill:none !important;
    color:#7b7b7c !important;
    stroke:#7b7b7c !important;
  }

  body .tp-header-mobile .tp-mobile-search svg.tp-mobile-search-icon circle,
  body .tp-header-mobile .tp-mobile-search svg.tp-mobile-search-icon line,
  body .tp-header-mobile .tp-mobile-search svg.tp-mobile-search-icon path{
    fill:none !important;
    stroke:currentColor !important;
    stroke-width:2 !important;
    stroke-linecap:round !important;
    stroke-linejoin:round !important;
  }

  html[data-tp-theme="dark"] body .tp-header-mobile .tp-mobile-search svg.tp-mobile-search-icon{
    color:#aeb8ca !important;
    stroke:#aeb8ca !important;
  }
}

@media (max-width:768px){
  body .tp-bottom-mobile .tp-bottom-sell .tp-bottom-sell-circle{
    fill:currentColor !important;
    stroke:none !important;
  }

  body .tp-bottom-mobile .tp-bottom-sell .tp-bottom-sell-plus,
  body .tp-bottom-mobile .tp-bottom-sell.is-active .tp-bottom-sell-plus{
    fill:none !important;
    stroke:#ffffff !important;
    stroke-width:2.45 !important;
    stroke-linecap:round !important;
    stroke-linejoin:round !important;
  }

  html[data-tp-theme="dark"] body .tp-bottom-mobile .tp-bottom-item.is-active{
    color:#60a5fa !important;
    background:rgba(59,130,246,.18) !important;
  }

  html[data-tp-theme="dark"] body .tp-bottom-mobile .tp-bottom-item.is-active > span,
  html[data-tp-theme="dark"] body .tp-bottom-mobile .tp-bottom-item.is-active > svg{
    color:#60a5fa !important;
  }

  html[data-tp-theme="dark"] body .tp-bottom-mobile .tp-bottom-sell .tp-bottom-sell-circle{
    fill:currentColor !important;
    stroke:none !important;
  }

  html[data-tp-theme="dark"] body .tp-bottom-mobile .tp-bottom-sell .tp-bottom-sell-plus,
  html[data-tp-theme="dark"] body .tp-bottom-mobile .tp-bottom-sell.is-active .tp-bottom-sell-plus{
    fill:none !important;
    stroke:#0b1120 !important;
  }
}

@media (max-width:768px){
  body:has(.offer-page-card) .page-content{
    min-height:0 !important;
    height:auto !important;
    flex:0 0 auto !important;
    padding-bottom:0 !important;
    margin-bottom:0 !important;
    overflow:visible !important;
  }

  body:has(.offer-page-card) .page{
    min-height:0 !important;
    height:auto !important;
    padding-bottom:0 !important;
    margin-bottom:0 !important;
  }

  body:has(.offer-page-card) .offer-page-card{
    padding-bottom:calc(var(--bottom-nav-h, 68px) + 30px + env(safe-area-inset-bottom, 0px)) !important;
    margin-bottom:0 !important;
  }

  body:has(.offer-page-card) .footer{
    margin-top:0 !important;
  }

  body:has(.offer-page-card) .offer-portfolio-section{
    margin-top:22px !important;
    padding-top:22px !important;
  }
}

html[data-tp-theme="dark"] body :is(.buybtn.buy-secondary,.buy-secondary){
  background:rgba(30,41,59,.86) !important;
  color:#bfdbfe !important;
  border:1.5px solid rgba(96,165,250,.52) !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] body :is(.buybtn.buy-secondary,.buy-secondary):hover,
html[data-tp-theme="dark"] body :is(.buybtn.buy-secondary,.buy-secondary):active{
  background:rgba(37,55,78,.92) !important;
  color:#dbeafe !important;
  border-color:rgba(96,165,250,.70) !important;
}

html[data-tp-theme="dark"] body :is(.tp-no-photo__label,.offer-image-empty-label){
  display:inline !important;
  min-width:0 !important;
  min-height:0 !important;
  padding:0 !important;
  margin:0 !important;
  background:transparent !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  color:#aeb8ca !important;
  -webkit-box-decoration-break:clone;
  box-decoration-break:clone;
}

@media (max-width:768px){
  html[data-tp-theme="dark"] body:has(.chat-shell) :is(.page-content,.wrap,.chat-shell,.left,.chat-list){
    background:transparent !important;
    border-color:transparent !important;
    box-shadow:none !important;
  }
}


/* ===== FINAL PATCH 2026-05-01: remaining mobile/dark fixes ===== */
@media (max-width:768px){
  body .tp-bottom-mobile .tp-bottom-sell .tp-bottom-sell-plus{
    display:block !important;
    fill:none !important;
    stroke:#ffffff !important;
    stroke-width:2.45 !important;
    stroke-linecap:round !important;
    stroke-linejoin:round !important;
    vector-effect:non-scaling-stroke;
    pointer-events:none;
  }

  html[data-tp-theme="dark"] body .tp-bottom-mobile .tp-bottom-sell .tp-bottom-sell-plus{
    stroke:#0b1120 !important;
  }

  html[data-tp-theme="dark"] body .tp-bottom-mobile .tp-bottom-sell.is-active .tp-bottom-sell-circle{
    fill:#60a5fa !important;
  }

  html[data-tp-theme="dark"] body .tp-bottom-mobile .tp-bottom-sell.is-active .tp-bottom-sell-plus{
    stroke:#0b1120 !important;
  }

  body:has(.offer-page-card) .offer-page-card{
    padding-bottom:24px !important;
    margin-bottom:0 !important;
  }

  body:has(.offer-page-card) .offer-desc-section{
    margin-top:0 !important;
    padding-top:22px !important;
  }

  body:has(.offer-page-card) .offer-portfolio-section{
    margin-top:22px !important;
    padding-top:22px !important;
  }

  body:has(.offer-page-card) #footer-container,
  body:has(.offer-page-card) .footer{
    margin-top:0 !important;
  }
}

html[data-tp-theme="dark"] body:has(.offer-page-card) #actionButtons .buybtn,
html[data-tp-theme="dark"] body:has(.offer-page-card) #actionButtons .buybtn.buy-secondary,
html[data-tp-theme="dark"] body:has(.offer-page-card) .offer-edit-btn{
  background:#1b2536 !important;
  color:#93c5fd !important;
  border:1.5px solid rgba(96,165,250,.42) !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] body:has(.offer-page-card) #actionButtons .buybtn:hover,
html[data-tp-theme="dark"] body:has(.offer-page-card) #actionButtons .buybtn:active,
html[data-tp-theme="dark"] body:has(.offer-page-card) .offer-edit-btn:hover,
html[data-tp-theme="dark"] body:has(.offer-page-card) .offer-edit-btn:active{
  background:#223149 !important;
  color:#bfdbfe !important;
  border-color:rgba(96,165,250,.62) !important;
}

html[data-tp-theme="dark"] .tp-mobile-search .tp-mobile-search-icon{
  color:#aeb8ca !important;
  stroke:#aeb8ca !important;
}

html[data-tp-theme="dark"] .tp-mobile-search .tp-mobile-search-icon :is(circle,line,path){
  stroke:#aeb8ca !important;
  fill:none !important;
}

/* ===== FINAL PATCH: burger menu dividers + softer menu font ===== */
.tp-burger-panel .tp-burger-row,
.tp-burger-panel .tp-burger-row-left,
.tp-burger-panel .tp-burger-row-left span,
.tp-burger-panel .tp-burger-value,
.tp-burger-panel .tp-burger-sub .tp-item,
#tpBurgerLangValue,
#tpBurgerCurValue,
#tpBurgerThemeValue{
  font-weight:500 !important;
}

/* Language row has a hidden submenu after it, so the default adjacent selector misses the divider before currency. */
.tp-burger-sub + .tp-burger-row{
  border-top:1px solid var(--line) !important;
}

html[data-tp-theme="dark"] .tp-burger-sub + .tp-burger-row{
  border-top-color:var(--tp-dark-line, rgba(148,163,184,.18)) !important;
}


/* ===== Final bugfix: loader logo descenders + profile logout row ===== */
.tp-page-loader-text,
.tp-page-loader-logo{
  line-height:1.22 !important;
  padding:0 .04em .14em !important;
  overflow:visible !important;
}

.tp-page-loader{
  overflow:visible !important;
}

.profile-menu .menu-item.logout-item{
  background:transparent !important;
  color:#dc2626 !important;
  border-top:1px solid #f1f5f9 !important;
}

.profile-menu .menu-item.logout-item:hover{
  background:#f3f4f6 !important;
  color:#b91c1c !important;
}

html[data-tp-theme="dark"] .profile-menu .menu-item.logout-item{
  background:var(--tp-dark-surface, #111827) !important;
  color:#f87171 !important;
  border-top:1px solid rgba(148,163,184,.22) !important;
}

html[data-tp-theme="dark"] .profile-menu .menu-item.logout-item:hover{
  background:var(--tp-dark-surface-2, #1f2937) !important;
  color:#fca5a5 !important;
}

/* ===== Profile beta disabled + UID copied visibility polish ===== */
html[data-tp-theme="dark"] body.profile-page .nav-item.is-disabled{
  color:rgba(148,163,184,.46) !important;
  background:rgba(15,23,42,.38) !important;
  border-color:rgba(148,163,184,.11) !important;
  box-shadow:none !important;
  opacity:.54 !important;
  filter:grayscale(.32) saturate(.65) !important;
}

html[data-tp-theme="dark"] body.profile-page .nav-item.is-disabled:hover,
html[data-tp-theme="dark"] body.profile-page .nav-item.is-disabled:active{
  color:rgba(148,163,184,.46) !important;
  background:rgba(15,23,42,.38) !important;
  border-color:rgba(148,163,184,.11) !important;
  box-shadow:none !important;
}

html[data-tp-theme="dark"] body.profile-page .user-id.is-copied,
html[data-tp-theme="dark"] body.profile-page .user-id.is-copied::after{
  color:#60a5fa !important;
}



/* ===== Shared copy feedback toast ===== */
.tp-copy-toast{
  position:fixed;
  left:50%;
  bottom:calc(104px + env(safe-area-inset-bottom, 0px));
  z-index:10050;
  max-width:min(320px, calc(100vw - 32px));
  padding:10px 14px;
  border-radius:999px;
  background:rgba(17,24,39,.92);
  color:#ffffff;
  font-size:14px;
  font-weight:800;
  line-height:1.2;
  text-align:center;
  box-shadow:0 14px 34px rgba(15,23,42,.24);
  opacity:0;
  transform:translate(-50%, 10px) scale(.98);
  transition:opacity .18s ease, transform .18s ease;
  pointer-events:none;
  white-space:nowrap;
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}

.tp-copy-toast.is-visible{
  opacity:1;
  transform:translate(-50%, 0) scale(1);
}

html[data-tp-theme="dark"] .tp-copy-toast{
  background:rgba(30,41,59,.92);
  color:#f8fafc;
  border:1px solid rgba(148,163,184,.22);
  box-shadow:0 18px 40px rgba(0,0,0,.38);
}

html[data-tp-theme="dark"] body.profile-page .user-id.is-copied::after,
html[data-tp-theme="dark"] .offer-public-id.is-copied::after{
  content:none !important;
  display:none !important;
}

@media (max-width:640px){
  .tp-copy-toast{
    bottom:calc(118px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce){
  .tp-copy-toast{
    transition:none !important;
  }
}











/* ===== CLEAN HEADER DESKTOP NAV v16 ===== */
.tp-actions{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:12px !important;
}

.tp-actions #tpFavorites,
.tp-actions #tpSell,
.tp-actions #tpChats,
.tp-actions #tpProfile{
  width:56px !important;
  min-width:56px !important;
  max-width:56px !important;
  height:52px !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  text-decoration:none !important;
  color:var(--muted) !important;

  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:4px !important;
}

.tp-actions #tpFavorites svg,
.tp-actions #tpSell svg,
.tp-actions #tpChats .tp-chat-svg,
.tp-actions #tpProfile .tp-profile-svg{
  width:22px !important;
  height:22px !important;
  min-width:22px !important;
  min-height:22px !important;
  max-width:22px !important;
  max-height:22px !important;
  display:block !important;
}

.tp-actions #tpFavorites > span,
.tp-actions #tpSell > span,
.tp-actions #tpChatsLabel,
.tp-actions #tpProfileLabel,
.tp-actions .tp-profilelabel{
  width:100% !important;
  margin:0 !important;
  text-align:center !important;
  white-space:nowrap !important;
  overflow:visible !important;
  text-overflow:clip !important;
  font-size:11px !important;
  font-weight:700 !important;
  line-height:1 !important;
  color:currentColor !important;
}

.tp-actions #tpSell,
.tp-actions #tpSell svg,
.tp-actions #tpSell .tp-sell-mobilelike-circle{
  color:var(--muted) !important;
  fill:currentColor !important;
  stroke:none !important;
}

.tp-actions #tpFavorites:hover,
.tp-actions #tpSell:hover,
.tp-actions #tpChats:hover,
.tp-actions #tpProfile:hover{
  color:#3b82f6 !important;
}

@media (max-width:720px){
  .tp-actions #tpFavorites,
  .tp-actions #tpSell{
    display:none !important;
  }
}
}

/* ===== Chat bell color consistency ===== */
html[data-tp-theme="dark"] .chat-notify-btn:not(.is-muted){
  color:#f4b400 !important;
}

html[data-tp-theme="dark"] .chat-notify-btn.is-muted{
  color:#dc2626 !important;
}