/* /cellbridge/iphone: дополнения к pg-cellbridge.css */
.cbi-hero         { padding-bottom: 2rem; }
.cbi-status       { padding-bottom: 1.5rem; }
.cbi-anchor       { scroll-margin-top: 96px; }
.cbi-back         { display: inline-flex; align-items: center; gap: 8px; color: rgb(148,163,184); font-size: .9rem; font-weight: 600; transition: color .2s; }
.cbi-back:hover   { color: #fff; }
.cbi-val          { display: inline-block; padding: 0 7px; border-radius: 7px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.10); color: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; white-space: nowrap; }
.cbi-h3-lg        { font-size: 1.375rem; }

/* Плашка статуса */
.cbi-note         { display: flex; align-items: flex-start; gap: 16px; }
.cbi-note-icon    { flex-shrink: 0; width: 44px; height: 44px; border-radius: 14px; background: rgba(234,179,8,0.15); display: flex; align-items: center; justify-content: center; }
@media (max-width: 639px) {
    .cbi-note     { flex-direction: column; gap: 12px; }
}

/* Схема соединения */
.cbi-flow         { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.cbi-flow-node    { flex: 1 1 0; min-width: 0; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.cbi-flow-tile    { width: 60px; height: 60px; border-radius: 18px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.cbi-flow-link    { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 4px 8px; }
.cbi-flow-label   { color: #fff; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.cbi-flow-arrow   { position: relative; display: block; width: 3px; height: 34px; border-radius: 3px; background: linear-gradient(180deg,#3b82f6,#22c55e); }
.cbi-flow-arrow::after { content: ""; position: absolute; left: 50%; bottom: -2px; width: 11px; height: 11px; border-right: 3px solid #22c55e; border-bottom: 3px solid #22c55e; transform: translateX(-50%) rotate(45deg); }
@media (min-width: 768px) {
    .cbi-flow       { flex-direction: row; align-items: center; }
    .cbi-flow-node  { align-self: stretch; }
    .cbi-flow-arrow { width: 170px; height: 3px; background: linear-gradient(90deg,#3b82f6,#22c55e); }
    .cbi-flow-arrow::after { left: auto; right: -1px; bottom: 50%; transform: translateY(50%) rotate(-45deg); }
}

/* Шаги */
.cbi-steps        { display: flex; flex-direction: column; gap: 20px; }
.cbi-step         { padding: 24px; }
.cbi-step:hover   { border-color: rgba(255,255,255,0.07); }
.cbi-step-head    { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.cbi-num          { flex-shrink: 0; width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem; font-weight: 900; }
.cbi-step-title   { font-size: 1.25rem; font-weight: 800; color: #fff; line-height: 1.25; }
.cbi-step-body    { display: flex; flex-direction: column; gap: 20px; }
.cbi-step-body > :not(.cbi-step-media) { flex: 1 1 0; min-width: 0; }
.cbi-step-media   { flex-shrink: 0; width: 100%; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 768px) {
    .cbi-step       { padding: 28px; }
    .cbi-step-body  { flex-direction: row; align-items: flex-start; gap: 28px; }
    .cbi-step-media { width: 340px; }
}

/* Списки */
.cbi-list         { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.cbi-list > li    { position: relative; padding-left: 18px; }
.cbi-list > li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: #60a5fa; }
.cbi-list b, .cbi-check b { color: #fff; font-weight: 700; }
.cbi-list b.text-green-300 { color: rgb(134,239,172); }
.cbi-check        { list-style: none; counter-reset: cbi; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cbi-check > li   { position: relative; counter-increment: cbi; padding-left: 36px; min-height: 26px; }
.cbi-check > li::before { content: counter(cbi); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,0.08); color: #fff; font-size: .8rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* Картинки */
.cbi-fig          { margin: 0; min-width: 0; }
.cbi-fig .screenshot { border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); min-height: 0; }
.cbi-fig .screenshot img { width: 100%; max-height: none; }
.cbi-fig figcaption { margin-top: 7px; }
.cbi-fig-pair     { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cbi-fig-pair figcaption { text-align: center; }
.cbi-inset        { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 20px; }

/* Типичная ошибка */
.cbi-mistake      { margin-top: 24px; padding: 20px; border-radius: 18px; border: 1px solid rgba(239,68,68,0.30); background: radial-gradient(ellipse at 0% 0%, rgba(239,68,68,0.09), transparent 60%), rgba(255,255,255,0.02); display: flex; flex-direction: column; gap: 20px; }
.cbi-mistake-text { flex: 1 1 0; min-width: 0; }
@media (min-width: 768px) {
    .cbi-mistake  { flex-direction: row; align-items: flex-start; gap: 28px; padding: 24px; }
}

/* Таблица настроек NMEAGps */
.cbi-settings     { background: #1c1c1e; border: 1px solid rgba(255,255,255,0.10); border-radius: 16px; overflow: hidden; }
.cbi-settings-title { padding: 12px 16px; color: rgb(148,163,184); font-size: .78rem; font-weight: 700; letter-spacing: .03em; border-bottom: 1px solid rgba(255,255,255,0.08); }
.cbi-settings-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; color: #fff; font-size: .95rem; }
.cbi-settings-row + .cbi-settings-row { border-top: 1px solid rgba(255,255,255,0.08); }
.cbi-settings-row.is-changed { background: rgba(34,197,94,0.09); }
.cbi-settings-val { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.cbi-settings-val b { color: rgb(134,239,172); font-weight: 800; }
.cbi-settings-val em { color: rgb(148,163,184); font-size: .78rem; font-style: normal; }
.cbi-toggle       { display: inline-block; position: relative; width: 38px; height: 22px; border-radius: 22px; background: rgba(255,255,255,0.18); flex-shrink: 0; }
.cbi-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.cbi-toggle--on   { background: #34c759; }
.cbi-toggle--on::after { left: 18px; }

/* Схема экрана CellReceiver */
.cbi-hu           { background: #1a1a1a; border: 1px solid rgba(255,255,255,0.10); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.cbi-hu-left      { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.cbi-hu-right     { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.cbi-hu-title     { color: #fff; font-size: 1rem; font-weight: 600; }
.cbi-hu-btn       { padding: 9px 30px; border-radius: 4px; background: #d6d7d7; color: #1a1a1a; font-size: 1rem; font-weight: 600; margin: 3px 0 5px; }
.cbi-hu-source    { color: #4CAF50; font-size: 1.05rem; font-weight: 600; }
.cbi-hu-coords    { color: #ccc; font-size: .84rem; }
.cbi-hu-muted     { color: #8f8f8f; font-size: .78rem; line-height: 1.45; }
.cbi-hu-ok        { color: #4CAF50; font-size: .78rem; line-height: 1.45; }
.cbi-hu-switch    { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; background: #2a2a2a; color: #fff; font-size: .95rem; margin-bottom: 4px; }
.cbi-hu-state     { font-size: .85rem; }
.cbi-hu-state.is-ok   { color: #4CAF50; }
.cbi-hu-state.is-bad  { color: #F44336; }
.cbi-hu-state.is-warn { color: #FFC107; }
.cbi-hu-ip        { color: #fff; font-size: .95rem; margin-top: 6px; }
@media (min-width: 768px) {
    .cbi-hu       { flex-direction: row; padding: 24px; gap: 26px; }
}

/* Таблица диагностики */
.cbi-diag         { border: 1px solid rgba(255,255,255,0.08); border-radius: 20px; overflow: hidden; background: rgba(255,255,255,0.02); }
.cbi-diag-head    { display: none; }
.cbi-diag-row     { display: flex; flex-direction: column; gap: 10px; padding: 18px; color: rgb(203,213,225); font-size: .9rem; line-height: 1.55; }
.cbi-diag-row + .cbi-diag-row { border-top: 1px solid rgba(255,255,255,0.08); }
.cbi-diag-row > [data-label]::before { content: attr(data-label); display: block; color: rgb(148,163,184); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.cbi-diag-state   { font-weight: 700; line-height: 1.35; }
.cbi-diag-state.is-muted { color: #a3a3a3; }
.cbi-diag-state.is-ok    { color: #4CAF50; }
.cbi-diag-state.is-text  { color: #e5e5e5; }
@media (min-width: 768px) {
    .cbi-diag-head { display: grid; grid-template-columns: 1fr 1.3fr 1.5fr; gap: 20px; padding: 13px 20px; color: rgb(148,163,184); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid rgba(255,255,255,0.08); }
    .cbi-diag-row  { display: grid; grid-template-columns: 1fr 1.3fr 1.5fr; gap: 20px; padding: 16px 20px; }
    .cbi-diag-row > [data-label]::before { display: none; }
}

/* XCITE: светлая тема. Экраны iPhone и ГУ (.cbi-settings, .cbi-hu) остаются тёмными, как на устройствах */
html[data-brand="xcite"] .cbi-back         { color: #7d695a; }
html[data-brand="xcite"] .cbi-back:hover   { color: #362620; }
html[data-brand="xcite"] .cbi-val          { background: rgba(54,38,32,0.06); border-color: rgba(54,38,32,0.14); color: #362620; }
html[data-brand="xcite"] .cbi-flow-label,
html[data-brand="xcite"] .cbi-step-title,
html[data-brand="xcite"] .cbi-list b,
html[data-brand="xcite"] .cbi-check b      { color: #362620; }
html[data-brand="xcite"] .cbi-list b.text-green-300 { color: #1f8a4d; }
html[data-brand="xcite"] .cbi-list > li::before { background: #2d5fc4; }
html[data-brand="xcite"] .cbi-check > li::before { background: rgba(54,38,32,0.08); color: #362620; }
html[data-brand="xcite"] .cbi-inset        { background: rgba(255,255,255,0.55); border-color: rgba(54,38,32,0.10); }
html[data-brand="xcite"] .cbi-fig .screenshot { border-color: rgba(54,38,32,0.10); }
html[data-brand="xcite"] .cbi-mistake      { background: radial-gradient(ellipse at 0% 0%, rgba(207,53,64,0.08), transparent 60%), #fdf7ea; border-color: rgba(207,53,64,0.30); }
html[data-brand="xcite"] .cbi-diag         { background: #fdf7ea; border-color: rgba(54,38,32,0.10); }
html[data-brand="xcite"] .cbi-diag-head    { color: #7d695a; border-color: rgba(54,38,32,0.10); }
html[data-brand="xcite"] .cbi-diag-row     { color: #55443a; }
html[data-brand="xcite"] .cbi-diag-row + .cbi-diag-row { border-color: rgba(54,38,32,0.10); }
html[data-brand="xcite"] .cbi-diag-row > [data-label]::before { color: #7d695a; }
html[data-brand="xcite"] .cbi-diag-state.is-muted { color: #7d695a; }
html[data-brand="xcite"] .cbi-diag-state.is-ok    { color: #1f8a4d; }
html[data-brand="xcite"] .cbi-diag-state.is-text  { color: #362620; }

/* Кнопки внизу */
.cbi-cta          { display: flex; flex-direction: column; gap: 12px; justify-content: center; align-items: stretch; }
@media (min-width: 640px) {
    .cbi-cta      { flex-direction: row; align-items: center; }
}
