/* Theme tokens */
:root { --surface: #ffffff; --surface-a: rgb(255 255 255 / .94); }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111418; --surface: #171c22; --surface-a: rgb(23 28 34 / .94); --soft: #1c2229; --soft-2: #252c35; --line: #2a313b; --line-2: #3a4350;
  --ink: #eef1f5; --ink-2: #c9d0d9; --muted: #9aa4b1;
  --blue: #4a7cff; --blue-2: #86a8ff; --blue-soft: #1a2747; --blue-line: #2f4680;
  --green: #4cc38a; --green-soft: #13301f; --red: #ff6b62; --red-soft: #3a1c1b; --amber: #f0b44c; --amber-soft: #3a2b12;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px rgb(0 0 0 / .35); --shadow-lift: 0 2px 6px rgb(0 0 0 / .35), 0 18px 40px rgb(0 0 0 / .5);
}
[data-theme="dark"] .tile { filter: invert(1) hue-rotate(180deg) brightness(.82) contrast(.92) saturate(.6); }

[data-theme="dark"] .chip[aria-pressed="true"], [data-theme="dark"] .chip.on, [data-theme="dark"] .chip-radio input:checked + span, [data-theme="dark"] .helper, [data-theme="dark"] .view-toggle, [data-theme="dark"] .toast { background: var(--ink); color: var(--bg); }
[data-theme="dark"] .card-badges .badge { background: rgb(17 20 24 / .85); color: var(--ink); }
::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; }
html[data-vt="theme"]::view-transition-old(root) { animation: none; }
html[data-vt="theme"]::view-transition-new(root) { animation: theme-wipe .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes theme-wipe { from { clip-path: circle(0% at calc(100% - 140px) 30px); } to { clip-path: circle(150% at calc(100% - 140px) 30px); } }
.chat-link .count, .nav-tab .count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; animation: pop-in .4s var(--spring); }
.nav-tab .count { right: calc(50% - 22px); top: 6px; }

/* Second filter row */
.filters-2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex-basis: 100%; padding-top: 10px; box-shadow: 0 -1px 0 var(--line); }
.filters-2 .select, .filters-2 .input { width: auto; min-height: 40px; padding: 8px 12px; border-color: var(--line); font-size: var(--t-sm); background-color: var(--surface); }
.filters-2 .select { padding-right: 34px; }
.filters-2 .input { width: 104px; }
.filters-2 .pair-inline { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--t-xs); }
.filters-2 .chip { min-height: 40px; background: var(--surface); border-color: var(--line); }
.filters-more { display: none; }
.view-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--soft); gap: 2px; }
.view-seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: var(--t-sm); transition: background-color .25s, color .25s; }
.view-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.view-seg .ic { width: 18px; height: 18px; }
.cat-bar-end { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 760px) {
  .filters-2 { display: none; }
  .filters.open .filters-2 { display: flex; animation: fade .35s var(--ease); }
  .filters-more { display: inline-flex; }
  .more-btn { display: none; }
  .filters-2 .input { flex: 1; width: auto; min-width: 0; }
  .filters-2 .select { flex: 1 1 100%; }
}

/* View modes: list rows, 3 tiles, map split */
.cat-split.view-grid, .cat-split.view-list { grid-template-columns: 1fr; }
.cat-split.view-grid .cat-map, .cat-split.view-list .cat-map { display: none; }
.cat-split.view-grid .cat-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cat-split.view-list .cat-list { grid-template-columns: 1fr; gap: 14px; }
.view-list .card { display: grid; grid-template-columns: minmax(220px, 34%) minmax(0, 1fr); gap: 20px; padding: 12px; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); }
.view-list .card:hover { box-shadow: 0 0 0 1px var(--line-2), var(--shadow); }
.view-list .card-body { padding-top: 4px; }

@media (max-width: 760px) {
  .cat-split.view-grid .cat-list { grid-template-columns: 1fr; }
  .view-list .card { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 8px; }
  .view-list .card-media { aspect-ratio: 1; }
  .view-list .card-media .photo-placeholder { min-height: 0; gap: 4px; padding: 6px; font-size: .75rem; line-height: 1.2; }
  .view-list .card-media .photo-placeholder-logo { flex: none; width: 76px; height: 17px; }
  .view-list .card-media .photo-placeholder > span:last-child { max-width: 100%; text-wrap: balance; }
  .view-list .card-media:has(.photo-placeholder) .fav { top: 0; right: 0; padding: 4px; place-items: start end; background: transparent; }
  .view-list .card-media:has(.photo-placeholder) .fav .ic { width: 24px; height: 24px; padding: 4px; border-radius: 50%; background: var(--surface-a); }
  .view-list .card-costs, .view-list .card-foot .badge { display: none; }
}

/* Hashtags */
.tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-2); font-size: var(--t-xs); font-weight: 700; text-decoration: none; transition: transform .25s var(--spring), background-color .2s; }
.tag:hover { transform: translateY(-1px); background: var(--blue-line); }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.badge-up { background: var(--green-soft); color: var(--green); }

/* Tenant request card */
.want { display: grid; gap: 8px; align-content: start; padding: 18px; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); background: var(--surface); transition: transform .35s var(--spring), box-shadow .25s; }
.want:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line-2), var(--shadow-lift); }
.want-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.want-budget { font-size: var(--t-lg); font-weight: 780; letter-spacing: -.02em; }
.want-budget span { font-size: var(--t-sm); font-weight: 500; color: var(--muted); }
.want-title { font-weight: 680; font-size: var(--t-md); }
.want-title a { text-decoration: none; } .want-title a:hover { color: var(--blue); }
.want-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.want-text { color: var(--ink-2); font-size: var(--t-sm); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kind-switch { display: flex; gap: 8px; margin-top: 14px; }

/* Chat */
.chat-wrap { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 560px; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.chat-list { list-style: none; margin: 0; padding: 0; background: var(--soft); overflow: auto; max-height: 70vh; }
.chat-list a { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; text-decoration: none; transition: background-color .2s; }
.chat-list a:hover { background: var(--soft-2); }
.chat-list a[aria-current] { background: var(--surface); box-shadow: inset 3px 0 0 var(--blue); }
.chat-list img, .chat-list .ph0 { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--soft-2); }
.chat-list b { display: block; font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list small { display: block; color: var(--muted); font-size: var(--t-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list .unread { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.conv { display: flex; flex-direction: column; min-width: 0; background: var(--surface); }
.conv-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; box-shadow: 0 1px 0 var(--line); }
.conv-head a { font-weight: 680; text-decoration: none; } .conv-head a:hover { color: var(--blue); }
.conv-msgs { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 18px; overflow: auto; max-height: 56vh; min-height: 300px; }
.conv-msgs .msg time { display: block; margin-top: 2px; font-size: 11px; opacity: .7; }
.msg.deleted { font-style: italic; opacity: .6; }
.conv-form { display: flex; gap: 8px; padding: 12px; box-shadow: 0 -1px 0 var(--line); }
.conv-form .textarea { min-height: 46px; height: 46px; resize: none; }
.conv-empty { display: grid; place-content: center; text-align: center; color: var(--muted); padding: 40px; gap: 8px; justify-items: center; }
.conv-back { display: none; }
@media (max-width: 760px) {
  .chat-wrap { grid-template-columns: 1fr; min-height: 0; }
  .chat-wrap.has-conv .chat-list { display: none; }
  .chat-wrap:not(.has-conv) .conv { display: none; }
  .conv-back { display: inline-grid; }
  .conv-msgs { max-height: calc(100dvh - 330px); }
}

/* Payment */
.pay { display: grid; gap: 14px; justify-items: center; text-align: center; }
.qr { width: min(280px, 80vw); height: auto; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); background: #fff; padding: 6px; }
.pay-sum { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.req { width: 100%; text-align: left; margin: 0; display: grid; gap: 2px; font-size: var(--t-xs); }
.req div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; box-shadow: 0 1px 0 var(--line); }
.req dt { color: var(--muted); } .req dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.svc-pick { display: grid; gap: 8px; }
.credits { margin-top: 24px; color: var(--muted); font-size: var(--t-xs); }
.credits summary { cursor: pointer; }
.content-edit .textarea { min-height: 260px; font-size: var(--t-sm); }
.fav.static { position: static; background: var(--soft); }
.kind-switch .chip { text-decoration: none; }
.want.is-promo, .want:has(.badge-promo) { box-shadow: 0 0 0 2px var(--blue-line); }
.want-badge { width: fit-content; }

/* Filters: at most two rows on desktop. Row 1: search, type, rooms, price. Row 2: district, area, floor, deposit, conditions. */
@media (min-width: 761px) {
  .filters { flex-wrap: wrap; row-gap: 10px; }
  .filters > .search-box { flex: 1 1 200px; min-width: 160px; }
  .filters > .seg { flex: none; flex-wrap: nowrap; }
  .filters > .price-box .input { width: 92px; }
  .filters-2 { flex-wrap: nowrap; overflow: visible; }
  .filters-2 > * { flex: none; }
  .filters-2 .input { width: 92px; }
}
@media (min-width: 761px) and (max-width: 1240px) {
  .filters > .seg.rooms .chip { min-width: 38px; padding: 0 10px; }
  .filters > .seg .chip { padding: 0 11px; }
  .filters-2 .pair-inline { font-size: 0; gap: 4px; }
  .filters-2 .input { width: 80px; }
}
.cond { position: relative; }
.cond summary { list-style: none; cursor: pointer; background: var(--surface); border-color: var(--line); }
.cond summary::-webkit-details-marker { display: none; }
.cond summary .ic:last-child { width: 16px; height: 16px; transition: transform .3s var(--spring); }
.cond[open] summary .ic:last-child { transform: rotate(180deg); }
.cond-panel { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; display: grid; gap: 6px; width: max-content; min-width: 240px; padding: 10px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-lift), 0 0 0 1px var(--line); animation: cond-in .28s var(--ease); }
.cond-panel .chip { justify-content: flex-start; }
@keyframes cond-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@media (max-width: 760px) { .cond-panel { position: static; width: 100%; box-shadow: none; padding: 6px 0 0; } .cond { flex: 1 1 100%; } }
@media (min-width: 761px) { .filters-2 { overflow: hidden; } .filters-2 .cond { margin-left: auto; } .filters-2 .cond[open] { position: static; } .filters { position: relative; } .cond-panel { right: 12px; top: auto; } }
.cat-top { grid-template-columns: minmax(0, 1fr); }
.filters, .filters-2 { min-width: 0; max-width: 100%; }
@media (min-width: 761px) { .filters > .search-box { min-width: 120px; } }
.auth-tabs { margin-bottom: 14px; }
.auth-tabs .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.auth-form { display: grid; gap: 14px; }
.pw { position: relative; display: block; }
.pw .input { padding-right: 48px; }
.pw-eye { position: absolute; right: 2px; top: 2px; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: var(--muted); font-size: var(--t-xs); }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Compact filter: everything fits in two rows on common desktop widths. */
@media (min-width: 761px) {
  .filters { gap: 8px; padding: 10px; }
  .filters .chip { min-height: 38px; padding: 0 12px; font-size: .875rem; }
  .filters .seg { gap: 4px; }
  .filters > .seg.rooms .chip { min-width: 36px; padding: 0 9px; }
  .filters .search-box { min-height: 40px; }
  .filters .search-input { padding: 8px 0; font-size: .9375rem; }
  .filters .price-box .input, .filters-2 .input { min-height: 38px; padding: 7px 10px; font-size: .875rem; width: 96px; }
  .filters-2 { gap: 6px; padding-top: 8px; }
  .filters-2 .select { min-height: 38px; font-size: .875rem; padding: 7px 30px 7px 10px; background-position: right 8px center; max-width: 170px; }
  .filters-2 .fx-pair { display: inline-flex; gap: 4px; }
  .filters-2 .fx-pair .input { width: 82px; }
  .filters-2 .fx-pair label + label .input { width: 56px; }
}
@media (min-width: 761px) and (max-width: 1240px) {
  .filters .chip { padding: 0 10px; font-size: .8125rem; }
  .filters .price-box .input, .filters-2 .input { width: 84px; }
  .filters-2 .select { max-width: 140px; }
}
@media (min-width: 761px) and (max-width: 1240px) {
  .filters { padding: 8px; gap: 6px; }
  .filters .chip { padding: 0 9px; }
  .filters-2 { gap: 5px; }
  .filters .price-box .input, .filters-2 .input { width: 74px; padding: 7px 8px; }
  .filters-2 .fx-pair .input { width: 72px; }
  .filters-2 .fx-pair label + label .input { width: 46px; }
  .filters-2 .select { max-width: 122px; }
  .filters > .search-box { min-width: 110px; }
}
/* Tiles: always three per row on desktop. */
@media (min-width: 761px) { .cat-split.view-grid .cat-list, .cat-split.no-map.view-grid .cat-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 18px; } }

/* Compare */
.cmp-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 999px; min-height: 32px; padding: 0 10px; font-size: var(--t-xs); font-weight: 600; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.cmp-btn .ic { width: 16px; height: 16px; }
.cmp-btn:hover { border-color: var(--ink-2); }
.cmp-btn.on { background: var(--blue-soft); color: var(--blue-2); border-color: var(--blue-line); }
.cmp-wide { grid-column: 1 / -1; justify-content: center; min-height: 46px; border-radius: var(--r-sm); font-size: var(--t-sm); }
.cmp-bar { position: fixed; z-index: 46; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lift); font-size: var(--t-sm); }
.cmp-bar .icon-btn { color: var(--bg); width: 36px; height: 36px; }
.cmp-bar .icon-btn:hover { background: rgb(255 255 255 / .12); }
.cmp-bar .btn:disabled { opacity: .5; }
body.map-mode .cmp-bar { bottom: calc(var(--tab-h) + 80px); }
@media (max-width: 760px) { .cmp-bar { bottom: calc(var(--tab-h) + 74px + env(safe-area-inset-bottom)); } body[data-page="listing"] .cmp-bar { bottom: 86px; } }
.cmp-sheet .sheet-head { align-items:center; gap:16px; padding:20px 24px 16px; }
.cmp-sheet .sheet-head h2 {
  min-width:0; margin:0; font-size:clamp(18px, 3.6vw, 21px);
  font-weight:650; line-height:1.25; letter-spacing:-.015em; text-wrap:pretty;
}
.cmp-sheet .sheet-head .icon-btn { flex:none; width:32px; height:32px; }
@media (max-width:760px) {
  .cmp-sheet .sheet-head { padding:8px 20px 16px; }
}
.cmp-wrap { overflow-x: auto; }
.cmp-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: var(--t-sm); min-width: 520px; overflow-wrap:anywhere; }
.cmp-label-col { width:150px; }
.cmp-table:has(col[span="3"]) { min-width:705px; }
.cmp-table:has(col[span="4"]) { min-width:890px; }
.cmp-table th, .cmp-table td { padding: 10px; text-align: left; vertical-align: top; box-shadow: inset 0 -1px 0 var(--line); }
.cmp-table tbody th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.cmp-table td.best { color: var(--green); font-weight: 700; background: var(--green-soft); }
.cmp-table .cmp-guide { position: relative; vertical-align: bottom; }
.cmp-guide-art {
  position: absolute; inset: 10px 10px 24px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
}
.cmp-guide-art > img { width:82%; max-width:112px; height:auto; object-fit:contain; }
.cmp-guide-art .cmp-brand-mark { width:32%; max-height:50px; }
[data-theme="dark"] .cmp-brand-mark { filter:grayscale(1) invert(1); }
.cmp-head { display: grid; gap: 6px; text-decoration: none; font-weight: 650; }
.logo.cms-brand-custom > :not(.cms-brand) { display:none; }
.logo .cms-brand { display:none; width:auto; max-width:190px; height:44px; object-fit:contain; }
.logo.cms-brand-custom .cms-brand { display:block; }
.cmp-photo { width:100%; aspect-ratio:4 / 3; overflow:hidden; border-radius:10px; position:relative; }
.cmp-photo > * { position:absolute; inset:0; width:100%; height:100%; }
.cmp-photo img { object-fit:cover; }
.cmp-photo .photo-placeholder { min-height:0; gap:6px; padding:8px; }
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--red); font-size: var(--t-xs); cursor: pointer; }
.card-foot .cmp-btn { margin-left: auto; }

/* Filter row 2 stretches to the full width, like row 1. */
@media (min-width: 761px) {
  .filters-2 > *:not(.cond) { flex: 1 1 auto; }
  .filters-2 > label, .filters-2 .fx-pair { display: flex; }
  .filters-2 .fx-pair label { flex: 1 1 0; }
  .filters-2 .input, .filters-2 .select { width: 100% !important; max-width: none; }
  .filters-2 .chip { justify-content: center; }
  .filters-2 > label:has(.select) { flex: 1.4 1 auto; }
}

/* Row 2 chips look exactly like row 1 chips: natural width, same padding, 4px between chips.
   The inputs and the district select take the remaining width instead. */
@media (min-width: 761px) {
  .filters-2 { gap: 8px; }
  .filters-2 > .chip { flex: 0 0 auto !important; padding: 0 12px; }
  .filters-2 > .chip + .chip { margin-left: -4px; }
  .filters-2 > label, .filters-2 > .fx-pair { flex: 1 1 0 !important; min-width: 60px; }
  .filters-2 > label:has(.select) { flex: 1.5 1 0 !important; }
  .filters-2 .fx-pair { flex-grow: 1.6 !important; }
}
@media (min-width: 761px) and (max-width: 1240px) {
  .filters-2 { gap: 6px; }
  .filters-2 > .chip { padding: 0 9px; }
  .filters-2 > .chip + .chip { margin-left: -2px; }
}

/* Harmonised cards: every text line has a fixed height, so cards in a row and rows across the page match. */
.cat-list { align-items: stretch; grid-auto-rows: 1fr; }
.cat-list > .empty { grid-row: auto; }
.card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; min-height: 2.6em; }
.card-facts, .card-addr, .card-costs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-addr { display: block; }
.card-addr .ic { display: inline-block; vertical-align: -3px; margin-right: 4px; }
.card-tags { min-height: 24px; }
.card-foot { margin-top: auto; flex-wrap: nowrap; }
.card-foot .badge { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.card-fresh { white-space: nowrap; }
.view-list .card-title { min-height: 0; -webkit-line-clamp: 1; }
.want-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.want p:not(.want-budget):not(.card-fresh) { min-height: 1.5em; }
.card-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 8px; }
.card-foot .badge { max-width: 100%; justify-self: start; }
.card-foot .cmp-btn { margin-left: 0; }
.card-foot .card-fresh { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; }

/* Paid card looks: pinned, highlighted. Visible but calm; labelled as advertising, not as verification. */
.badge-pin { background: var(--ink) !important; color: var(--bg) !important; }
.card.is-hl { background: var(--amber-soft); box-shadow: 0 0 0 2px #f0b44c; padding: 8px 8px 12px; }
.card.is-hl .card-media { border-radius: 12px; }
.card.is-pin .card-media { box-shadow: 0 0 0 2px var(--ink); }
.view-list .card.is-hl { padding: 12px; }

/* Services in the cabinet */
.balance { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--r); background: var(--green-soft); color: var(--green); }
.balance .btn { margin-left: auto; }
.ent { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.ent > div { display: grid; gap: 2px; padding: 16px; border-radius: var(--r-lg); background: var(--soft); }
.ent b { font-size: var(--t-lg); }
.ent small { color: var(--muted); font-size: var(--t-xs); }
.buy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.buy { display: grid; gap: 8px; align-content: start; padding: 16px; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); transition: transform .3s var(--spring), box-shadow .25s; }
.buy:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line-2), var(--shadow); }
.buy h3 { font-size: var(--t-md); }
.buy .btn { justify-self: start; }
.notice-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r); background: var(--blue-soft); color: var(--blue-2); }
.notice-box p { flex: 1; min-width: 200px; }
.unread-row { box-shadow: inset 3px 0 0 var(--blue); }
.save-search { min-height: 42px; }
.tariff-row { grid-template-columns: 1.3fr 1.6fr .7fr .6fr .7fr 2fr auto; }
@media (max-width: 760px) { .save-search span, .save-search { font-size: var(--t-xs); } }

/* Site editor */
.cms-workspace { display:grid; gap:18px; align-content:start; }
.cms-workspace [hidden] { display:none !important; }
.cms-card p,.cms-patch p { margin:0; color:var(--muted); }
.cms-save-state,.cms-patch-state { display:inline-block; flex-shrink:0; background:var(--green-soft); color:var(--green); padding:5px 10px; border-radius:8px; font-size:var(--t-xs); font-weight:650; }
.cms-dirty,.cms-patch-state[data-state="staged"] { background:var(--blue-soft); color:var(--blue); }
.cms-patch-state[data-state="rolledback"] { background:var(--soft); color:var(--muted); }
.cms-nav { display:flex; gap:4px; flex-wrap:wrap; border-bottom:1px solid var(--line); }
.cms-nav button { border:0; border-bottom:2px solid transparent; background:transparent; color:var(--muted); display:flex; align-items:center; gap:7px; padding:10px 13px; font-weight:650; cursor:pointer; }
.cms-nav button[aria-pressed="true"] { color:var(--blue); border-color:var(--blue); }
.cms-nav .ic { width:17px; height:17px; }
.cms-editor,.cms-preview { min-width:0; }
.cms-card { background:var(--surface); border:1px solid var(--line); border-radius:16px; display:grid; gap:10px; padding:16px; }
.cms-card h3,.cms-card h4 { margin:0; }
.cms-card label:not(.cms-file) { font-weight:600; font-size:var(--t-sm); }
.cms-card :is(.select,.input,.textarea) { min-width:0; width:100%; }
.cms-preview { overflow:hidden; background:var(--surface); }
.cms-preview-head { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:5px 12px; padding:12px 16px; border-bottom:1px solid var(--line); }
.cms-preview-head span { color:var(--muted); font-size:var(--t-xs); }
.cms-preview iframe { display:block; width:100%; height:clamp(380px,64vh,740px); border:0; background:var(--surface); }
.cms-preview-empty { padding:24px; background:var(--soft); color:var(--muted); overflow-wrap:anywhere; }
.cms-field-list { display:grid; align-content:start; max-height:clamp(145px,26vh,300px); overflow:auto; border:1px solid var(--line); border-radius:10px; }
.cms-choice { display:flex; align-items:center; gap:10px; text-align:left; padding:9px 11px; border:0; border-bottom:1px solid var(--line); background:var(--surface); color:inherit; cursor:pointer; }
.cms-choice:last-child { border-bottom:0; }
.cms-choice:hover,.cms-choice[aria-pressed="true"] { background:var(--blue-soft); color:var(--blue); }
.cms-choice > span { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; min-width:0; flex:1; }
.cms-choice > img { width:52px; height:30px; object-fit:contain; }
.cms-choice > .ic { width:15px; height:15px; flex:none; }
.cms-choice small,.cms-history-row small { display:block; color:var(--muted); }
.cms-edit-card { display:grid; gap:8px; padding-top:10px; }
.cms-edit-card .hint { overflow-wrap:anywhere; }
.cms-edit-card .btn { justify-self:start; white-space:normal; }
.cms-image-current { width:160px; height:80px; object-fit:contain; background:var(--soft); border-radius:10px; padding:6px; }
.cms-empty { padding:14px; color:var(--muted); font-size:var(--t-sm); }
.cms-file { display:grid; gap:7px; padding:12px; background:var(--soft); border:1px dashed var(--line); border-radius:10px; cursor:pointer; overflow-wrap:anywhere; }
.cms-file input { width:100%; min-width:0; font-size:var(--t-xs); }
.cms-file input::file-selector-button { font:inherit; color:var(--blue); background:var(--blue-soft); border:0; border-radius:6px; padding:6px 9px; cursor:pointer; margin-right:6px; }
.cms-publish { position:sticky; bottom:0; z-index:2; display:flex; justify-content:flex-end; align-items:center; gap:8px; flex-wrap:wrap; background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:10px 12px; }
.cms-publish span { margin-right:auto; color:var(--muted); }
.cms-plain { border-top:1px solid var(--line); padding:8px 0; }
.cms-plain summary { cursor:pointer; padding:6px 0; font-weight:600; }
.cms-plain textarea { margin:8px 0; }
.cms-plain p { margin:6px 0; }
.cms-history-row,.cms-patch { border-top:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; padding:12px 0; }
.cms-update-intro { display:grid; gap:10px; justify-items:start; }
.cms-update-intro .cms-file { width:min(100%,470px); }
.cms-patch-upload .ic { width:24px; height:24px; color:var(--blue); }
.cms-patch-actions { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.cms-error { color:var(--red) !important; }
.cms-review { display:grid; gap:10px; padding-left:20px; overflow-wrap:anywhere; }
.cms-review p { margin:4px 0; white-space:pre-wrap; }
.cms-preview-page [data-cms-editable]:hover:not(:has([data-cms-editable]:hover)) { outline:2px solid var(--blue); outline-offset:1px; cursor:pointer; }
@media (max-width: 460px) { .cms-publish .btn { white-space:normal; } }

/* The website is the canvas; tools open above it without resizing the page. */
body:has(.cms-workspace) > :is(.topbar,.tabbar,.footer,.helper) { display:none; }
.cms-workspace { gap:0; min-width:0; background:var(--soft); }
.cms-toolbar { padding:12px var(--pad) 0; background:var(--surface); border-bottom:1px solid var(--line); }
.cms-toolbar-top { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.cms-toolbar-top h1 { margin:0; font-size:clamp(17px,2vw,23px); letter-spacing:-.02em; }
.cms-toolbar-top .select { width:min(100%,250px); min-width:0; margin-right:auto; }
.cms-toolbar .cms-nav { margin-top:7px; border:0; }
.cms-toolbar .cms-nav button { min-height:40px; }
.cms-workspace .cms-layout { display:block; position:relative; }
.cms-workspace .cms-preview { position:static; border:0; border-radius:0; }
.cms-workspace .cms-preview-head { padding:8px var(--pad); background:var(--blue-soft); }
.cms-workspace .cms-preview-head span { color:var(--ink); }
.cms-workspace .cms-preview iframe { height:max(510px,calc(100dvh - 136px)); }
.cms-drawer { position:absolute; top:48px; right:14px; max-height:calc(100% - 62px); width:min(365px,calc(100% - 28px)); overflow:auto; border:1px solid var(--line); border-radius:15px; background:var(--surface); box-shadow:0 14px 45px #0003; z-index:1; }
.cms-drawer .cms-card { border:0; padding:14px; }
.cms-drawer h3 { padding-right:36px; }
.cms-close { position:absolute; right:8px; top:8px; }
.cms-workspace > .cms-card { width:min(820px,calc(100% - 2 * var(--pad))); margin:20px auto; }
.cms-workspace .cms-publish { margin:0 var(--pad); }
.cms-preview-page,html:has(.cms-preview-page) { overflow-x:hidden; }
.cms-preview-page [data-cms-editable]:focus-visible { outline:2px solid var(--blue); }
@media (max-width: 620px) {
  .cms-toolbar { padding-inline:10px; }
  .cms-toolbar-top { gap:8px; }
  .cms-toolbar-top .select { width:100%; order:2; }
  .cms-toolbar-top .cms-save-state { margin-left:auto; }
  .cms-toolbar-top > a { order:3; }
  .cms-toolbar .cms-nav { gap:0; }
  .cms-toolbar .cms-nav button { padding:7px 8px; }
  .cms-drawer { top:auto; max-height:58%; right:8px; bottom:8px; width:calc(100% - 16px); }
  .cms-workspace .cms-preview iframe { height:max(480px,calc(100dvh - var(--top-h) - 240px)); }
}

.audit-filters { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,165px),1fr)); gap:10px; align-items:end; margin-bottom:16px; }
.audit-filters label { display:grid; gap:4px; min-width:0; font-size:var(--t-sm); }
.audit-filters :is(.input,.select) { min-width:0; width:100%; }
.audit-results { display:grid; gap:8px; margin:12px 0; }
.audit-item { border:1px solid var(--line); border-radius:12px; background:var(--surface); padding:12px 14px; }
.audit-item header { display:flex; justify-content:space-between; flex-wrap:wrap; gap:6px 16px; }
.audit-item :is(time,p) { font-size:var(--t-sm); color:var(--muted); }
.audit-item p { margin:4px 0; overflow-wrap:anywhere; }
.audit-item summary { cursor:pointer; color:var(--blue); margin-top:7px; }
.audit-diff { width:100%; table-layout:fixed; text-align:left; margin-top:8px; font-size:var(--t-sm); border-collapse:collapse; }
.audit-diff :is(th,td) { border-top:1px solid var(--line); vertical-align:top; padding:7px; white-space:pre-wrap; overflow-wrap:anywhere; }
.audit-diff th:first-child { width:26%; }
@media (max-width: 620px) {
  .cms-workspace:has(.cms-publish:not([hidden])) .cms-drawer { bottom:116px; max-height:calc(100% - 132px); }
}
