:root {
  --bg: var(--tg-theme-bg-color, #fff);
  --secondary-bg: var(--tg-theme-secondary-bg-color, #f4f4f5);
  --text: var(--tg-theme-text-color, #101114);
  --hint: var(--tg-theme-hint-color, #707579);
  --link: var(--tg-theme-link-color, #2481cc);
  --button: var(--tg-theme-button-color, #2481cc);
  --button-text: var(--tg-theme-button-text-color, #fff);
  --separator: color-mix(in srgb, var(--hint) 20%, transparent);
  --safe-top: max(env(safe-area-inset-top), var(--app-content-safe-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom), var(--app-content-safe-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 14px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { overscroll-behavior-y: none; }
button, input, select { font: inherit; }
/* iOS WebView zooms the entire Mini App when a focused form control is below
   16px. Keep browser zoom available to the user; only prevent that automatic
   focus zoom on phones. */
@media (max-width: 700px) {
  input, select, textarea { font-size: 16px; }
}
button { border: 0; cursor: pointer; }
#app { min-height: 100vh; padding: calc(40px + var(--safe-top)) 12px calc(72px + var(--safe-bottom)); }
.view { max-width: 680px; margin: 0 auto; }
.topline { display: flex; justify-content: space-between; align-items: center; min-height: 34px; margin: 0 4px 10px; }
.title { font-size: 20px; font-weight: 700; letter-spacing: -.25px; }
.status { font-size: 13px; font-weight: 600; color: var(--hint); }
.online { color: #31a24c; } .offline { color: #e35d5b; } .paused { color: #e1a317; }
.panel { background: var(--secondary-bg); border-radius: 13px; padding: 10px; margin: 8px 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; padding: 0; background: var(--separator); }
.stat { background: var(--secondary-bg); padding: 10px; min-height: 58px; }
.stat strong { display: block; font-size: 18px; line-height: 1.1; }.stat span { color: var(--hint); font-size: 12px; }
.primary, .secondary { min-height: 45px; border-radius: 11px; width: 100%; font-weight: 650; padding: 0 14px; }
.primary { background: var(--button); color: var(--button-text); }.secondary { background: var(--secondary-bg); color: var(--link); }
.section-label { color: var(--hint); font-size: 12px; margin: 15px 4px 5px; font-weight: 650; }
.list { background: var(--secondary-bg); border-radius: 13px; overflow: hidden; }.item { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 52px; padding: 8px 11px; border-bottom: 1px solid var(--separator); background: transparent; color: var(--text); text-align: left; }.item:last-child { border-bottom: 0; }
.source-badge { display: grid; place-content: center; width: 31px; height: 31px; flex: none; border-radius: 9px; font-size: 14px; }.source-badge.telegram { background: color-mix(in srgb, #2481cc 16%, transparent); color: #2481cc; }.source-badge.nine { background: color-mix(in srgb, #e85d3f 17%, transparent); }.source-badge.makler { background: color-mix(in srgb, #7b61ff 17%, transparent); }.web-history .item-meta strong { color: var(--text); font-weight: 650; }
.item-main { min-width: 0; flex: 1; }.item-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 650; }.item-meta { color: var(--hint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.score { font-size: 12px; padding: 3px 7px; border-radius: 10px; background: color-mix(in srgb, var(--link) 12%, transparent); color: var(--link); }
.history-filter { display: flex; gap: 7px; overflow-x: auto; margin: 0 0 7px; padding: 1px 1px 3px; scrollbar-width: none; }.history-filter::-webkit-scrollbar { display: none; }.history-tab { flex: 0 0 auto; padding: 7px 10px; border-radius: 10px; color: var(--hint); background: var(--secondary-bg); font-size: 12px; font-weight: 600; }.history-tab.active { color: var(--button-text); background: var(--button); }.history-scroll { max-height: clamp(220px, 43vh, 430px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border-radius: 13px; }.history-mark { color: #e5a20a; margin-right: 3px; }.reject-mark { color: var(--hint); font-size: 11px; }.retention-note { margin: 7px 4px 0; color: var(--hint); font-size: 11px; line-height: 1.35; }.static-field > span:last-child { color: var(--hint); font-size: 12px; }
.empty { color: var(--hint); text-align: center; padding: 30px 20px; }.empty p { margin: 4px auto 16px; max-width: 280px; }
.tabs { position: fixed; z-index: 3; left: 0; right: 0; bottom: 0; height: calc(60px + var(--safe-bottom)); padding-bottom: var(--safe-bottom); display: grid; grid-template-columns: repeat(4, 1fr); background: color-mix(in srgb, var(--bg) 92%, transparent); border-top: 1px solid var(--separator); backdrop-filter: blur(16px); }
.tab { color: var(--hint); background: transparent; font-size: 11px; display: grid; place-content: center; gap: 3px; }.tab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }.tab.active { color: var(--link); font-weight: 700; }
.search { width: 100%; border: 0; outline: none; border-radius: 10px; background: var(--secondary-bg); color: var(--text); padding: 11px 12px; margin: 0 0 8px; }.search::placeholder { color: var(--hint); }
.toggle { position: relative; flex: 0 0 46px; width: 46px; height: 28px; border-radius: 15px; background: #b7b7b9; }.toggle::after { content: ""; position: absolute; width: 22px; height: 22px; top: 3px; left: 3px; background: white; border-radius: 50%; transition: transform .16s ease; }.toggle.on { background: var(--button); }.toggle.on::after { transform: translateX(18px); }
.row-action { color: var(--link); background: transparent; font-weight: 600; padding: 8px; }.row-action:disabled { color: var(--hint); }
.field { display: grid; gap: 5px; padding: 10px 12px; border-bottom: 1px solid var(--separator); }.field:last-child { border: 0; }.field label { color: var(--hint); font-size: 13px; }.field input, .field select { background: transparent; border: 0; outline: none; color: var(--text); padding: 2px 0; width: 100%; }
.field .check-row { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 14px; cursor: pointer; }.field .check-row input { appearance: none; flex: 0 0 20px; width: 20px; height: 20px; margin: 0; padding: 0; border: 1px solid var(--hint); border-radius: 6px; background: transparent; }.field .check-row input:checked { border-color: var(--button); background: var(--button); box-shadow: inset 0 0 0 4px var(--secondary-bg); }
.brand-list { margin-bottom: 8px; }.brand-row { gap: 8px; min-height: 52px; }.brand-row .toggle { transform: scale(.82); transform-origin: left center; margin-right: -7px; }.brand-name { width: 100%; padding: 4px 0; color: var(--text); background: transparent; border: 0; outline: 0; font-weight: 650; }.brand-name:not([readonly]) { padding: 6px 8px; border-radius: 8px; background: color-mix(in srgb, var(--link) 10%, var(--secondary-bg)); }.brand-row .row-action { padding: 7px 4px; font-size: 12px; white-space: nowrap; }.brand-row .destructive { color: #d65a5a; }.brand-add { display: flex; gap: 8px; align-items: center; padding: 5px 4px 4px; }.brand-add input { min-width: 0; flex: 1; padding: 10px 11px; color: var(--text); background: var(--secondary-bg); border: 0; border-radius: 10px; outline: 0; }.brand-add .row-action { flex: none; padding: 9px 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 9px; padding: 7px 9px; background: var(--secondary-bg); margin: 2px; }.chip button { color: var(--hint); background: transparent; padding: 0; font-size: 16px; }
.filter-note { color: var(--hint); font-size: 12px; line-height: 1.35; }
.detail-sheet { position: fixed; z-index: 4; inset: auto 0 0; max-height: min(88vh, 760px); padding: 8px 14px calc(18px + var(--safe-bottom)); overflow: auto; background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 28px #0002; }.sheet-handle { width: 36px; height: 4px; border-radius: 5px; margin: 1px auto 8px; background: color-mix(in srgb, var(--hint) 35%, transparent); }.detail-sheet .topline { margin-bottom: 8px; }.scrim { position: fixed; z-index: 3; inset: 0; background: #0008; }.toast { position: fixed; z-index: 6; left: 50%; bottom: calc(72px + var(--safe-bottom)); transform: translate(-50%, 12px); opacity: 0; pointer-events: none; background: #1c1c1e; color: white; border-radius: 10px; padding: 9px 13px; font-size: 13px; transition: .18s; }.toast.show { transform: translate(-50%, 0); opacity: 1; }
.listing-gallery { position: relative; display: grid; place-items: center; width: 100%; height: min(34vh, 260px); overflow: hidden; border-radius: 14px; margin: 2px 0 10px; color: var(--hint); background: var(--secondary-bg); padding: 0; }.listing-gallery img { display: block; width: 100%; height: 100%; object-fit: cover; }.gallery-unavailable { font-size: 12px; padding: 16px; }.listing-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }.listing-head h2 { font-size: 19px; line-height: 1.2; letter-spacing: -.2px; margin: 2px 0 3px; }.listing-status { flex: none; border-radius: 9px; padding: 4px 7px; color: #277a42; background: color-mix(in srgb, #31a24c 14%, transparent); font-size: 11px; font-weight: 700; }.listing-status.rejected { color: #b34848; background: color-mix(in srgb, #e35d5b 14%, transparent); }.listing-price { font-size: 18px; font-weight: 720; margin: 10px 0 7px; }.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border-radius: 11px; background: var(--separator); margin: 9px 0; }.fact { min-width: 0; padding: 7px 9px; background: var(--secondary-bg); }.fact span { display: block; color: var(--hint); font-size: 11px; }.fact strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }.description { max-height: 104px; overflow: auto; margin: 10px 0; color: var(--text); white-space: pre-wrap; font-size: 13px; line-height: 1.4; }.decision-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 11px 0 8px; }.state-button { min-height: 37px; border-radius: 10px; color: var(--text); background: var(--secondary-bg); font-weight: 650; font-size: 13px; }.state-button.selected { color: #a66d00; background: color-mix(in srgb, #e5a20a 18%, var(--secondary-bg)); }.state-button.reject.selected { color: #b34848; background: color-mix(in srgb, #e35d5b 16%, var(--secondary-bg)); }.detail-actions { display: grid; gap: 8px; }.primary.compact, .secondary.compact { min-height: 41px; }.original-text { margin-top: 13px; color: var(--hint); font-size: 12px; }.original-text summary { cursor: pointer; }.original-text pre { margin: 7px 0 0; max-height: 180px; overflow: auto; white-space: pre-wrap; color: var(--text); font: 12px/1.4 inherit; }.image-viewer { position: fixed; z-index: 8; inset: 0; display: grid; place-items: center; padding: 18px; background: #000e; }.image-viewer button { display: grid; place-items: center; width: 100%; height: 100%; padding: 0; background: transparent; }.image-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.skeleton { background: linear-gradient(90deg, var(--secondary-bg), color-mix(in srgb, var(--hint) 12%, var(--secondary-bg)), var(--secondary-bg)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }.hero { height: 90px; }.row { height: 58px; margin-top: 8px; } @keyframes shimmer { to { background-position: -200% 0; } }
.small { font-size: 13px; color: var(--hint); }.icon { width: 34px; height: 34px; flex: none; display: grid; place-content: center; background: color-mix(in srgb, var(--link) 14%, transparent); color: var(--link); border-radius: 50%; font-weight: 700; }
.setting-icon { width: 32px; height: 32px; flex: none; display: grid; place-content: center; border-radius: 10px; background: color-mix(in srgb, var(--link) 13%, transparent); color: var(--link); }.setting-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }.system-row { min-height: 56px; }.field-label { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 550; }.field-label .setting-icon { width: 28px; height: 28px; border-radius: 8px; }.field-label .setting-icon svg { width: 16px; height: 16px; }
.connection-card { margin-bottom: 2px; }.connection-note, .connection-login { padding: 9px 11px 10px; color: var(--hint); font-size: 12px; line-height: 1.35; border-top: 1px solid var(--separator); }.connection-note { display: flex; align-items: center; gap: 8px; }.connection-note .connection-reconnect { flex: none; padding: 7px 3px; white-space: nowrap; }.connection-login p { margin: 0 0 7px; }.telegram-login-form { display: grid; gap: 7px; }.telegram-login-form .field { padding: 5px 0 7px; }.telegram-login-form .secondary { min-height: 38px; }
.danger-panel { color: var(--hint); font-size: 12px; line-height: 1.4; }.danger-panel p { margin: 0 0 9px; }.danger-panel code { color: var(--text); font-size: 11px; user-select: all; }.danger-action { color: #d9534f; background: color-mix(in srgb, #d9534f 12%, var(--secondary-bg)); }.danger-action:disabled { color: var(--hint); background: var(--secondary-bg); }.danger-panel form { display: grid; gap: 8px; }.danger-panel input { width: 100%; border: 0; border-radius: 9px; outline: 0; padding: 10px; color: var(--text); background: color-mix(in srgb, var(--hint) 10%, var(--secondary-bg)); }
