/* «Радио под ваш город»: блок на /apps/fm-radio и конструктор города /radio/*.
   Цвета — из pg-app-page.css (--acc, --ap-*): тёмные темы omoda/tenet/chery и светлая XCITE. */
html {
    --rd-input: rgba(255,255,255,.05);
    --rd-line: rgba(255,255,255,.12);
    --rd-line-h: rgba(255,255,255,.25);
    --rd-tile: #ffffff;
    --rd-ok: #34d399;
    --rd-warn: #fbbf24;
    --rd-bad: #f87171;
    --rd-pop: #15171c;
}
html[data-brand="tenet"] { --rd-pop: #0c1022; }
html[data-brand="chery"] { --rd-pop: #220b0b; }
html[data-brand="xcite"] {
    --rd-input: #f7edd9;
    --rd-line: rgba(54,38,32,.14);
    --rd-line-h: rgba(54,38,32,.28);
    --rd-ok: #15803d;
    --rd-warn: #b45309;
    --rd-bad: #b91c1c;
    --rd-pop: #fffaf0;
}

.rd { display: flex; flex-direction: column; gap: 1.1rem; padding: 1.4rem; margin: 0 0 2rem; border-radius: 1.4rem;
      border: 1px solid color-mix(in srgb, var(--acc) 35%, transparent);
      background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 10%, transparent), color-mix(in srgb, var(--acc) 2%, transparent)), var(--ap-surface);
      box-shadow: var(--ap-shadow); }
.rd-head { display: flex; gap: .9rem; align-items: flex-start; }
.rd-ico { width: 3rem; height: 3rem; border-radius: .9rem; flex-shrink: 0; display: grid; place-items: center;
          background: color-mix(in srgb, var(--acc) 16%, transparent); color: var(--acc); }
.rd-ico svg { width: 1.6rem; height: 1.6rem; }
.rd-h2 { font-size: 1.5rem; line-height: 1.2; font-weight: 800; color: var(--ap-head); margin: 0; }
.rd-lead { color: var(--ap-muted); margin: .3rem 0 0; font-size: .95rem; line-height: 1.5; }
.rd-lbl { font-size: .78rem; color: var(--ap-muted); margin: 0 0 .35rem; display: block; }
.rd-input { width: 100%; height: 3rem; padding: 0 1rem; border-radius: .75rem; font: inherit; font-size: .95rem;
            background: var(--rd-input); border: 1px solid var(--rd-line); color: var(--ap-head); }
.rd-input::placeholder { color: var(--ap-muted); }
.rd-input:focus { outline: none; border-color: var(--acc); }
select.rd-input { appearance: none; padding-right: 2.2rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--ap-muted) 50%), linear-gradient(135deg, var(--ap-muted) 50%, transparent 50%);
    background-position: calc(100% - 1.2rem) 1.35rem, calc(100% - .9rem) 1.35rem; background-size: .3rem .3rem; background-repeat: no-repeat; }

.rd-countries { display: flex; flex-direction: column; gap: .5rem; }
.rd-country { border: 1px solid var(--rd-line); border-radius: .9rem; background: var(--ap-surface2); overflow: hidden; }
.rd-country > button { width: 100%; display: flex; align-items: center; gap: .6rem; padding: .8rem .9rem; border: 0; background: transparent;
                       cursor: pointer; font: inherit; font-weight: 700; font-size: 1rem; color: var(--ap-head); text-align: left; }
.rd-country > button small { font-weight: 500; font-size: .82rem; color: var(--ap-muted); }
.rd-chev { margin-left: auto; color: var(--ap-muted); transition: transform .2s; }
.rd-country.is-open .rd-chev { transform: rotate(180deg); }
.rd-empty { padding: 0 .9rem .9rem; color: var(--ap-muted); font-size: .9rem; margin: 0; }

.rd-regions { padding: .2rem .9rem .9rem; columns: 4 11rem; column-gap: 1.25rem; }
.rd-reg { break-inside: avoid; padding: .35rem 0 .5rem; }
.rd-reg-name { margin: 0 0 .1rem; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ap-muted); }
.rd-city { display: block; width: calc(100% + .7rem); text-align: left; border: 0; background: transparent; cursor: pointer; font: inherit;
           font-size: .9rem; line-height: 1.3; color: var(--ap-text); padding: .25rem .35rem; margin: 0 -.35rem; border-radius: .5rem; }
.rd-city:hover { background: color-mix(in srgb, var(--acc) 10%, transparent); color: var(--ap-head); }
.rd-city.is-sel { background: color-mix(in srgb, var(--acc) 16%, transparent); color: var(--ap-head); font-weight: 700; }
.rd-own { font-size: .68rem; font-weight: 700; color: var(--acc); margin-left: .3rem; text-transform: uppercase; letter-spacing: .04em; }

.rd-view { border-top: 1px solid var(--rd-line); margin: 0 .9rem; padding: .9rem 0; display: flex; flex-direction: column; gap: .7rem; }
.rd-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.rd-view-title { font-weight: 700; color: var(--ap-head); }
.rd-small { font-size: .82rem; color: var(--ap-muted); margin: 0; }
.rd-stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .5rem; }
.rd-st { display: flex; align-items: center; gap: .6rem; padding: .45rem; border-radius: .75rem; background: var(--ap-surface2); border: 1px solid var(--rd-line); min-width: 0; }
.rd-st div { min-width: 0; }
.rd-st b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .8rem; line-height: 1.2; color: var(--ap-head); }
.rd-st span { font-size: .75rem; color: var(--ap-muted); font-variant-numeric: tabular-nums; }
.rd-logo { width: 2.25rem; height: 2.25rem; border-radius: .5rem; background: var(--rd-tile); flex-shrink: 0; object-fit: cover; border: 1px solid var(--ap-border); }
.rd-logo.is-none { display: grid; place-items: center; font-size: .6rem; font-weight: 700; color: #64748b; }

.rd-add { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: 1rem; border-radius: 1rem;
          border: 1px dashed color-mix(in srgb, var(--acc) 55%, transparent); background: color-mix(in srgb, var(--acc) 6%, transparent); }
.rd-add b { color: var(--ap-head); font-size: 1rem; }
.rd-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 3rem; padding: 0 1.3rem; border-radius: .9rem;
          font: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; border: 1px solid var(--acc);
          background: var(--acc); color: #fff; }
.rd-btn:hover { filter: brightness(1.06); }
.rd-btn--ghost { background: transparent; color: var(--ap-head); border-color: var(--rd-line-h); }
.rd-btn--sm { height: 2.4rem; font-size: .85rem; padding: 0 .9rem; border-radius: .7rem; }
.rd-btn[disabled] { opacity: .55; cursor: default; }

/* ---------- конструктор города ---------- */
.rd-page { display: flex; flex-direction: column; gap: 1rem; }
.rd-card { display: flex; flex-direction: column; gap: 1rem; padding: 1.2rem; border-radius: 1.2rem; background: var(--ap-surface);
           border: 1px solid var(--ap-border); box-shadow: var(--ap-shadow); min-width: 0; }
.rd-grid3 { display: grid; grid-template-columns: 11rem 1fr 1fr; gap: .75rem; align-items: end; }
.rd-findrow { display: flex; gap: .75rem; align-items: flex-end; }
.rd-findrow > div { flex: 1; min-width: 0; }
@media (max-width: 640px) { .rd-grid3 { grid-template-columns: 1fr; } .rd { padding: 1.1rem; } .rd-h2 { font-size: 1.25rem; } }

.rd-pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 700; padding: .2rem .65rem; border-radius: 999px; white-space: nowrap; }
.rd-pill::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.rd-pill.ok { color: var(--rd-ok); background: color-mix(in srgb, var(--rd-ok) 13%, transparent); }
.rd-pill.warn { color: var(--rd-warn); background: color-mix(in srgb, var(--rd-warn) 14%, transparent); }
.rd-pill.bad { color: var(--rd-bad); background: color-mix(in srgb, var(--rd-bad) 13%, transparent); }

.rd-note { padding: .8rem .95rem; border-radius: .8rem; font-size: .9rem; line-height: 1.45; color: var(--ap-text);
           background: color-mix(in srgb, var(--acc) 8%, transparent); border: 1px solid color-mix(in srgb, var(--acc) 25%, transparent); margin: 0; }
.rd-note.ok { background: color-mix(in srgb, var(--rd-ok) 10%, transparent); border-color: color-mix(in srgb, var(--rd-ok) 35%, transparent); }
.rd-note.warn { background: color-mix(in srgb, var(--rd-warn) 9%, transparent); border-color: color-mix(in srgb, var(--rd-warn) 32%, transparent); }
.rd-note.bad { background: color-mix(in srgb, var(--rd-bad) 8%, transparent); border-color: color-mix(in srgb, var(--rd-bad) 30%, transparent); }
.rd-note b { color: var(--ap-head); }

.rd-tablewrap { margin: 0 -.25rem; }   /* без overflow: иначе подсказки станций обрезаются внутри таблицы */
.rd-table { width: 100%; border-collapse: separate; border-spacing: 0 .4rem; min-width: 30rem; }
.rd-table th { text-align: left; font-size: .75rem; color: var(--ap-muted); font-weight: 600; padding: 0 .35rem; }
.rd-table td { padding: 0 .35rem; vertical-align: middle; }
.rd-table .rd-input { height: 2.7rem; border-radius: .65rem; }
.rd-table .rd-freq { width: 6rem; font-variant-numeric: tabular-nums; }
.rd-table .rd-logo { width: 2.7rem; height: 2.7rem; }
.rd-del { width: 2.4rem; height: 2.4rem; border-radius: .65rem; border: 1px solid var(--rd-line); background: transparent; color: var(--ap-muted); cursor: pointer; font-size: 1.1rem; }
.rd-upl { height: 2.7rem; padding: 0 .75rem; border-radius: .65rem; border: 1px dashed color-mix(in srgb, var(--acc) 70%, transparent);
          background: color-mix(in srgb, var(--acc) 8%, transparent); color: var(--acc); font: inherit; font-weight: 600; font-size: .8rem; cursor: pointer; white-space: nowrap; }
.rd-sug { position: relative; }
.rd-drop { position: absolute; left: 0; right: 0; top: calc(100% + .25rem); z-index: 5; padding: .35rem; border-radius: .8rem; background: var(--rd-pop);
           border: 1px solid var(--rd-line-h); box-shadow: 0 .6rem 1.8rem rgba(0,0,0,.3); display: flex; flex-direction: column; gap: .1rem; }
.rd-drop button { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem; border: 0; border-radius: .5rem; background: transparent;
                  color: var(--ap-head); font: inherit; font-size: .88rem; cursor: pointer; text-align: left; }
.rd-drop button:hover, .rd-drop button:focus { background: color-mix(in srgb, var(--acc) 14%, transparent); outline: none; }
.rd-drop img, .rd-drop .rd-logo { width: 1.6rem; height: 1.6rem; border-radius: .35rem; }
.rd-drop small { margin-left: auto; color: var(--ap-muted); font-size: .72rem; }
.rd-paste { width: 100%; min-height: 9rem; padding: .8rem 1rem; border-radius: .75rem; font: inherit; font-size: .9rem; resize: vertical;
            background: var(--rd-input); border: 1px solid var(--rd-line); color: var(--ap-head); }
.rd-bar { display: flex; flex-wrap: wrap; gap: .6rem; }
.rd-err { color: var(--rd-bad); font-size: .85rem; margin: 0; }

/* [hidden] на сайте не скрывает элементы с display:flex — скрываем явно */
.rd [hidden], .rd-page [hidden], .rd-card[hidden] { display: none !important; }

.rd #rd-my a { color: var(--acc); font-weight: 600; }

/* XCITE — светлый тёплый сайт: блок как его карточки (#fdf7ea, тонкая коричневатая рамка, тёплая тень),
   без цветной подкладки акцента; вложенные плашки чуть темнее фона карточки. */
html[data-brand="xcite"] .rd { background: #fdf7ea; border-color: rgba(54,38,32,.10); box-shadow: 0 6px 22px rgba(150,95,45,.10); }
html[data-brand="xcite"] .rd-country,
html[data-brand="xcite"] .rd-st { background: #f8efdd; border-color: rgba(54,38,32,.10); }
html[data-brand="xcite"] .rd-add { background: #f8efdd; border-color: rgba(54,38,32,.22); }
html[data-brand="xcite"] .rd-ico { background: rgba(207,53,64,.10); color: #cf3540; }
html[data-brand="xcite"] .rd-logo { border-color: rgba(54,38,32,.10); }
html[data-brand="xcite"] .rd-city:hover { background: rgba(54,38,32,.06); }
html[data-brand="xcite"] .rd-city.is-sel { background: rgba(207,53,64,.12); color: #362620; }

/* ---------- точка входа на /apps/fm-radio ---------- */
.rd-entry { display: flex; flex-direction: column; gap: 1.2rem; padding: 1.6rem; margin: 0 0 2.2rem; border-radius: 1.5rem;
            text-decoration: none; color: inherit; border: 1px solid color-mix(in srgb, var(--acc) 40%, transparent);
            background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--acc) 22%, transparent), transparent 60%),
                        linear-gradient(160deg, color-mix(in srgb, var(--acc) 12%, transparent), color-mix(in srgb, var(--acc) 2%, transparent)), var(--ap-surface);
            box-shadow: var(--ap-shadow); transition: border-color .2s, transform .2s; }
.rd-entry:hover { border-color: var(--acc); transform: translateY(-2px); }
.rd-entry-top { display: flex; gap: 1rem; align-items: flex-start; }
.rd-entry-ico { width: 3.6rem; height: 3.6rem; border-radius: 1rem; flex-shrink: 0; display: grid; place-items: center;
                background: color-mix(in srgb, var(--acc) 18%, transparent); color: var(--acc); }
.rd-entry-ico svg { width: 2rem; height: 2rem; }
.rd-entry-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.rd-entry-title { font-size: 1.9rem; line-height: 1.15; font-weight: 800; color: var(--ap-head); }
.rd-entry-lead { font-size: 1rem; line-height: 1.5; color: var(--ap-muted); max-width: 34rem; }
.rd-entry-logos { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .55rem; min-height: 1rem; }
.rd-entry-logos img { width: 100%; aspect-ratio: 1; border-radius: .7rem; background: #fff; object-fit: cover; box-shadow: 0 0 0 1px var(--ap-border); }
.rd-entry-bottom { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.rd-entry-stats { font-size: .9rem; color: var(--ap-text); font-variant-numeric: tabular-nums; }
.rd-entry-btn { flex-shrink: 0; }
html[data-brand="xcite"] .rd-entry { background: radial-gradient(120% 90% at 100% 0%, rgba(207,53,64,.08), transparent 60%), #fdf7ea;
                                     border-color: rgba(54,38,32,.12); box-shadow: 0 6px 22px rgba(150,95,45,.10); }
html[data-brand="xcite"] .rd-entry:hover { border-color: rgba(207,53,64,.45); }
html[data-brand="xcite"] .rd-entry-ico { background: rgba(207,53,64,.10); color: #cf3540; }
@media (max-width: 640px) {
    .rd-entry { padding: 1.2rem; }
    .rd-entry-ico { display: none; }
    .rd-entry-logos { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .rd-entry-btn { width: 100%; }
    .rd-entry-title { font-size: 1.4rem; }
}

/* флаг страны в списке */
.rd-flag { width: 1.6rem; height: 1.1rem; border-radius: .2rem; flex-shrink: 0; overflow: hidden; box-shadow: 0 0 0 1px var(--rd-line); display: block; }
.rd-country > button { font-size: 1.05rem; padding: .95rem 1rem; gap: .7rem; }

/* на странице /radio заголовок блока — H1 страницы */
.rd h1.rd-h2 { font-size: 1.9rem; }
@media (max-width: 640px) { .rd h1.rd-h2 { font-size: 1.45rem; } }

/* ---------- окно города ---------- */
.rd-noscroll { overflow: hidden; }
.rd-dlg { padding: 0; border: 0; background: transparent; width: min(46rem, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); color: var(--ap-text); }
.rd-dlg::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
html[data-brand="xcite"] .rd-dlg::backdrop { background: rgba(54,38,32,.35); }
.rd-dlg-in { display: flex; flex-direction: column; max-height: calc(100vh - 3rem); border-radius: 1.3rem; overflow: hidden;
             background: var(--rd-pop); border: 1px solid var(--rd-line-h); box-shadow: 0 1.5rem 4rem rgba(0,0,0,.45); }
html[data-brand="xcite"] .rd-dlg-in { background: #fdf7ea; border-color: rgba(54,38,32,.14); box-shadow: 0 1.5rem 4rem rgba(150,95,45,.25); }
.rd-dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.3rem .9rem; border-bottom: 1px solid var(--rd-line); }
.rd-dlg-titles { min-width: 0; }
.rd-dlg-title { margin: 0; font-size: 1.5rem; line-height: 1.2; font-weight: 800; color: var(--ap-head); }
.rd-dlg-x { width: 2.75rem; height: 2.75rem; flex-shrink: 0; border-radius: .8rem; border: 1px solid var(--rd-line); background: transparent;
            color: var(--ap-head); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.rd-dlg-x:hover { border-color: var(--acc); }
.rd-dlg-body { padding: 1rem 1.3rem; overflow-y: auto; overscroll-behavior: contain; }
.rd-dlg-foot { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; padding: .9rem 1.3rem 1.1rem; border-top: 1px solid var(--rd-line); }
.rd-dlg-foot:empty { display: none; }
.rd-dlg-foot b { color: var(--ap-head); }
@media (prefers-reduced-motion: no-preference) {
    .rd-dlg[open] .rd-dlg-in { animation: rd-pop .18s ease-out; }
    @keyframes rd-pop { from { opacity: 0; transform: translateY(.6rem) scale(.985); } to { opacity: 1; transform: none; } }
}

/* ---------- телефон ---------- */
@media (max-width: 640px) {
    /* страница городов */
    .rd { padding: 1rem; gap: .9rem; border-radius: 1.1rem; margin-left: -.25rem; margin-right: -.25rem; }
    .rd-head { gap: .7rem; }
    .rd-head .rd-ico { display: none; }
    .rd-ico svg { width: 1.35rem; height: 1.35rem; }
    .rd-lead { font-size: .9rem; }
    .rd-input { height: 3.1rem; font-size: 1rem; }               /* 16px — iOS не увеличивает страницу при вводе */
    .rd-country > button { padding: .9rem .85rem; font-size: 1rem; min-height: 3.2rem; }
    .rd-regions { columns: 1; padding: .1rem .85rem .8rem; }
    .rd-reg { padding: .45rem 0 .55rem; }
    .rd-reg-name { font-size: .66rem; }
    .rd-city { font-size: .95rem; padding: .45rem .35rem; }       /* палец попадает: строка ~40px */
    .rd-add { flex-direction: column; align-items: stretch; text-align: left; }
    .rd-add .rd-btn { width: 100%; }

    /* окно города — на весь экран */
    .rd-dlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; }
    .rd-dlg-in { height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
    .rd-dlg-head { padding: max(.9rem, env(safe-area-inset-top)) 1rem .8rem; }
    .rd-dlg-title { font-size: 1.3rem; }
    .rd-dlg-body { padding: .9rem 1rem; }
    .rd-dlg-foot { padding: .8rem 1rem max(1rem, env(safe-area-inset-bottom)); flex-direction: column; align-items: stretch; }
    .rd-dlg-foot .rd-btn { width: 100%; }
    .rd-stations { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* конструктор: строка = частота | станция | логотип | ×, без горизонтальной прокрутки */
    .rd-card { padding: 1rem; border-radius: 1rem; }
    .rd-findrow { flex-direction: column; align-items: stretch; }
    .rd-bar > .rd-btn { flex: 1 1 auto; }
    .rd-tablewrap { overflow: visible; margin: 0; }
    .rd-table { min-width: 0; border-spacing: 0; }
    .rd-table thead { display: none; }
    .rd-table tbody { display: flex; flex-direction: column; gap: .5rem; }
    .rd-table tr { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) 2.4rem; grid-template-areas: "logo name del" "logo freq ."; gap: .4rem .6rem;
                   align-items: center; padding: .55rem; border-radius: .9rem; background: var(--ap-surface2); border: 1px solid var(--rd-line); }
    .rd-table td { padding: 0; min-width: 0; }
    .rd-table td:nth-child(1) { grid-area: freq; }
    .rd-table td:nth-child(2) { grid-area: name; }
    .rd-table td:nth-child(3) { grid-area: logo; align-self: stretch; display: grid; place-items: center; }
    .rd-table td:nth-child(4) { grid-area: del; align-self: start; }
    .rd-table .rd-freq { width: 6.5rem; text-align: left; }
    .rd-table .rd-input { height: 2.75rem; font-size: 1rem; padding: 0 .7rem; }
    .rd-table .rd-logo { width: 3.4rem; height: 3.4rem; border-radius: .7rem; }
    .rd-upl { width: 3.4rem; height: 3.4rem; padding: 0; font-size: 0; display: grid; place-items: center; border-radius: .7rem; }
    .rd-upl::before { content: "+"; font-size: 1.5rem; font-weight: 600; line-height: 1; }
    .rd-del { width: 2.4rem; height: 2.4rem; }
    .rd-drop { left: 0; right: 0; }
}

/* области свёрнуты: строка области — кнопка, города раскрываются под ней */
.rd-reg { padding: 0; }
.rd-reg-btn { display: flex; align-items: center; gap: .5rem; width: calc(100% + .7rem); margin: 0 -.35rem; padding: .45rem .35rem; border: 0; border-radius: .55rem;
              background: transparent; cursor: pointer; font: inherit; font-size: .92rem; font-weight: 600; color: var(--ap-head); text-align: left; }
.rd-reg-btn:hover { background: color-mix(in srgb, var(--acc) 10%, transparent); }
.rd-reg-label { flex: 1; min-width: 0; }
.rd-reg-btn small { font-size: .75rem; font-weight: 600; color: var(--ap-muted); min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: 999px;
                    display: inline-grid; place-items: center; background: color-mix(in srgb, var(--ap-muted) 14%, transparent); }
.rd-reg.is-open > .rd-reg-btn small { background: color-mix(in srgb, var(--acc) 22%, transparent); color: var(--acc); }
.rd-reg-cities { margin: .1rem 0 .45rem .35rem; padding-left: .55rem; border-left: 2px solid color-mix(in srgb, var(--acc) 35%, transparent); }
.rd-reg-cities .rd-city { font-size: .9rem; }
html[data-brand="xcite"] .rd-reg-btn:hover { background: rgba(54,38,32,.06); }
html[data-brand="xcite"] .rd-reg.is-open > .rd-reg-btn small { background: rgba(207,53,64,.12); color: #cf3540; }
html[data-brand="xcite"] .rd-reg-cities { border-left-color: rgba(207,53,64,.35); }
@media (max-width: 640px) {
    .rd-reg-btn { font-size: .95rem; padding: .55rem .35rem; }
}

/* ---------- окно города: заполненность, станции плитками, призыв поправить ---------- */
.rd-dlg-title { display: flex; align-items: center; gap: .6rem; }
.rd-dlg-title .rd-flag { width: 1.75rem; height: 1.2rem; }
.rd-dlg-title span { min-width: 0; overflow-wrap: anywhere; }

.rd-health { padding: .9rem 1rem; border-radius: 1rem; background: var(--ap-surface2); border: 1px solid var(--rd-line); display: flex; flex-direction: column; gap: .55rem; }
.rd-health-top { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; color: var(--ap-text); font-size: .95rem; }
.rd-health-top b { color: var(--ap-head); }
.rd-health-pct { font-weight: 800; font-size: 1.15rem; color: var(--rd-warn); font-variant-numeric: tabular-nums; }
.rd-meter { height: .5rem; border-radius: 999px; background: color-mix(in srgb, var(--ap-muted) 18%, transparent); overflow: hidden; }
.rd-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--rd-warn), color-mix(in srgb, var(--rd-warn) 60%, var(--rd-ok))); }
.rd-health.is-full .rd-health-pct { color: var(--rd-ok); }
.rd-health.is-full .rd-meter i { background: var(--rd-ok); }

.rd-tiles-hint { margin: 1rem 0 .55rem; }
.rd-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr)); gap: .7rem .55rem; }
.rd-tile { display: flex; flex-direction: column; gap: .3rem; min-width: 0; padding: .35rem; margin: -.35rem; border-radius: .9rem;
           text-decoration: none; color: inherit; transition: background-color .15s; }
.rd-tile:hover, .rd-tile:focus-visible { background: color-mix(in srgb, var(--acc) 10%, transparent); outline: none; }
.rd-tile-logo { display: block; width: 100%; aspect-ratio: 1; border-radius: .8rem; background: var(--rd-tile); object-fit: cover;
                border: 1px solid var(--ap-border); }
.rd-tile-logo.is-gap { display: grid; place-content: center; justify-items: center; gap: .1rem; background: color-mix(in srgb, var(--acc) 6%, transparent);
                       border: 2px dashed color-mix(in srgb, var(--acc) 55%, transparent); color: var(--acc); font-size: .72rem; font-weight: 700; }
.rd-tile-logo.is-gap b { font-size: 1.6rem; line-height: 1; font-weight: 500; }
.rd-tile:hover .rd-tile-logo.is-gap { background: color-mix(in srgb, var(--acc) 14%, transparent); border-style: solid; }
.rd-tile-f { font-weight: 800; font-size: .95rem; line-height: 1.1; color: var(--ap-head); font-variant-numeric: tabular-nums; }
.rd-tile-n { font-size: .78rem; line-height: 1.25; color: var(--ap-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.rd-howto { margin-top: 1.1rem; }

.rd-dlg-foot.rd-cta, .rd-dlg-foot:has(.rd-cta-text) { background: color-mix(in srgb, var(--acc) 7%, transparent); flex-wrap: nowrap; }
.rd-cta-text { display: flex; flex-direction: column; gap: .2rem; min-width: 0; font-size: .88rem; line-height: 1.4; color: var(--ap-text); }
.rd-cta-text b { font-size: 1rem; }
.rd-dlg-foot .rd-btn { flex-shrink: 0; }

html[data-brand="xcite"] .rd-health { background: #f8efdd; border-color: rgba(54,38,32,.10); }
html[data-brand="xcite"] .rd-tile:hover, html[data-brand="xcite"] .rd-tile:focus-visible { background: rgba(54,38,32,.06); }
html[data-brand="xcite"] .rd-tile-logo { border-color: rgba(54,38,32,.12); }
html[data-brand="xcite"] .rd-tile-logo.is-gap { background: rgba(207,53,64,.05); border-color: rgba(207,53,64,.45); color: #cf3540; }
html[data-brand="xcite"] .rd-tile:hover .rd-tile-logo.is-gap { background: rgba(207,53,64,.10); }
html[data-brand="xcite"] .rd-dlg-foot:has(.rd-cta-text) { background: #f8efdd; }

/* ---------- конструктор: что изменено ---------- */
.rd-table tr.is-new td:first-child, .rd-table tr.is-changed td:first-child { box-shadow: inset 3px 0 0 var(--rd-ok); border-radius: .4rem 0 0 .4rem; }
.rd-table tr.is-changed td:first-child { box-shadow: inset 3px 0 0 var(--rd-warn); }
.rd-table tr.is-focus .rd-input, .rd-table tr.is-focus .rd-upl { border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 25%, transparent); }
.rd-diff { font-size: .85rem; color: var(--ap-muted); margin: 0; }
.rd-diff b { color: var(--ap-head); }
.rd-diff .n { color: var(--rd-ok); font-weight: 700; }
.rd-diff .c { color: var(--rd-warn); font-weight: 700; }
.rd-diff .r { color: var(--rd-bad); font-weight: 700; }
.rd-meta { margin: 0; color: var(--ap-head); font-weight: 600; }

@media (max-width: 640px) {
    .rd-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem .5rem; }
    .rd-health { padding: .8rem .85rem; }
    .rd-dlg-foot:has(.rd-cta-text) { flex-wrap: wrap; }
    .rd-cta-text { font-size: .84rem; }
    .rd-table tr.is-new, .rd-table tr.is-changed { border-left: 3px solid var(--rd-ok); }
    .rd-table tr.is-changed { border-left-color: var(--rd-warn); }
    .rd-table tr.is-new td:first-child, .rd-table tr.is-changed td:first-child { box-shadow: none; }
    .rd-table tr.is-focus { border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 25%, transparent); }
}

/* Выпадающий список у select рисует система: на Windows он белый, а текст тёмных тем — белый (варианты не видно).
   Свои цвета вариантам + тёмная схема контрола; у светлого XCITE — светлая. */
select.rd-input { color-scheme: dark; }
select.rd-input option { background-color: var(--rd-pop); color: var(--ap-head); }
html[data-brand="xcite"] select.rd-input { color-scheme: light; }

/* ---------- свой выпадающий список (страна, область в конструкторе) ---------- */
.rd-pick { position: relative; }
.rd-pick-native { display: none !important; }
.rd-pick-btn { display: flex; align-items: center; justify-content: space-between; gap: .6rem; text-align: left; cursor: pointer; }
.rd-pick-btn::after { content: ""; flex-shrink: 0; width: .45rem; height: .45rem; margin-top: -.25rem; border-right: 2px solid var(--ap-muted);
                      border-bottom: 2px solid var(--ap-muted); transform: rotate(45deg); transition: transform .15s, margin .15s; }
.rd-pick.is-open .rd-pick-btn { border-color: var(--acc); }
.rd-pick.is-open .rd-pick-btn::after { transform: rotate(-135deg); margin-top: .2rem; }
.rd-pick.is-bad .rd-pick-btn { border-color: var(--rd-bad); }
.rd-pick-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-pick-val.is-empty { color: var(--ap-muted); }
.rd-pick-pop { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + .35rem); min-width: 15rem; padding: .4rem; border-radius: .9rem;
               background: var(--rd-pop); border: 1px solid var(--rd-line-h); box-shadow: 0 .8rem 2.2rem rgba(0,0,0,.4);
               display: flex; flex-direction: column; gap: .4rem; }
.rd-pick-q { height: 2.6rem; font-size: .95rem; border-radius: .6rem; }
.rd-pick-list { position: relative; max-height: min(20rem, 55vh); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 1px; }
.rd-pick-opt { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; text-align: left; padding: .55rem .7rem;
               border: 0; border-radius: .55rem; background: transparent; color: var(--ap-text); font: inherit; font-size: .92rem; line-height: 1.3; cursor: pointer; }
.rd-pick-opt:hover, .rd-pick-opt.is-act { background: color-mix(in srgb, var(--acc) 14%, transparent); color: var(--ap-head); }
.rd-pick-opt.is-sel { color: var(--acc); font-weight: 700; }
.rd-pick-opt.is-sel::after { content: "✓"; }
.rd-pick-none { margin: 0; padding: .6rem .7rem; color: var(--ap-muted); font-size: .88rem; }
html[data-brand="xcite"] .rd-pick-pop { background: #fffaf0; border-color: rgba(54,38,32,.16); box-shadow: 0 .8rem 2.2rem rgba(150,95,45,.18); }
html[data-brand="xcite"] .rd-pick-opt:hover, html[data-brand="xcite"] .rd-pick-opt.is-act { background: rgba(54,38,32,.06); color: #362620; }
html[data-brand="xcite"] .rd-pick-opt.is-sel { color: #cf3540; }
html[data-brand="xcite"] .rd-pick.is-open .rd-pick-btn { border-color: #cf3540; }
@media (max-width: 640px) {
    .rd-pick-q { height: 2.9rem; font-size: 1rem; }
    .rd-pick-opt { padding: .7rem .75rem; font-size: 1rem; }
    .rd-pick-list { max-height: 50vh; }
}

/* подсказки городов в конструкторе (поле «Город») */
.rd-drop.rd-cities { z-index: 25; max-height: min(22rem, 60vh); overflow-y: auto; }
.rd-drop.rd-cities { left: auto; right: 0; min-width: 17rem; }
.rd-drop.rd-cities button { flex-direction: column; align-items: flex-start; gap: .05rem; padding: .5rem .65rem; }
.rd-drop.rd-cities button span { font-weight: 600; }
.rd-drop.rd-cities small { margin-left: 0; font-size: .74rem; }
.rd-drop.rd-cities small.is-known { color: var(--acc); font-weight: 600; }
.rd-drop button.is-act { background: color-mix(in srgb, var(--acc) 14%, transparent); }
.rd-drop-src { margin: .25rem .5rem .1rem; font-size: .68rem; color: var(--ap-muted); }
.rd-drop-hint { margin: 0; padding: .55rem .6rem; font-size: .88rem; line-height: 1.4; color: var(--ap-muted); }
html[data-brand="xcite"] .rd-drop { background: #fffaf0; border-color: rgba(54,38,32,.16); box-shadow: 0 .6rem 1.8rem rgba(150,95,45,.18); }
html[data-brand="xcite"] .rd-drop button:hover, html[data-brand="xcite"] .rd-drop button:focus, html[data-brand="xcite"] .rd-drop button.is-act { background: rgba(54,38,32,.06); }
@media (max-width: 640px) { .rd-drop.rd-cities { left: 0; min-width: 0; } .rd-drop.rd-cities button { padding: .65rem .7rem; font-size: 1rem; } }
