[data-theme="light"] {
      --bg: #F0EFE9;
      --card: #FFFFFF;
      --card2: #EAEAE3;
      --ink: #1A1917;
      --ink2: #5E5D59;
      --ink3: #9B9A96;
      --line: #D8D7D0;
      --teal: #0F6E56;
      --teal-bg: #D4EEE5;
      --teal-mid: #1D9E75;
      --teal-dk: #085041;
      --red: #A32D2D;
      --red-bg: #FAEAEA;
      --amber: #5A3204;
      --amber-bg: #F0DDB8;
      --info-bg: #E6F1FB;
      --info: #185FA5;
      --wa: #25D366;
      --shadow: rgba(0, 0, 0, .06)
    }

    [data-theme="gray"] {
      --bg: #D1D5DB;
      --card: #F9FAFB;
      --card2: #F3F4F6;
      --ink: #111827;
      --ink2: #374151;
      --ink3: #6B7280;
      --line: #9CA3AF;
      --teal: #065F46;
      --teal-bg: #A7F3D0;
      --teal-mid: #059669;
      --teal-dk: #064E3B;
      --red: #991B1B;
      --red-bg: #FEE2E2;
      --amber: #78350F;
      --amber-bg: #FDE68A;
      --info-bg: #DBEAFE;
      --info: #1D4ED8;
      --wa: #15803D;
      --shadow: rgba(0, 0, 0, .1)
    }

    [data-theme="dark"] {
      --bg: #0E0D0C;
      --card: #1A1917;
      --card2: #222120;
      --ink: #E4E3DE;
      --ink2: #8A8984;
      --ink3: #4A4946;
      --line: #2A2927;
      --teal: #1D9E75;
      --teal-bg: #0B2D20;
      --teal-mid: #1D9E75;
      --teal-dk: #4DC9A0;
      --red: #E24B4A;
      --red-bg: #2A0E0E;
      --amber: #EF9F27;
      --amber-bg: #2A1600;
      --info-bg: #1E3A5F;
      --info: #60A5FA;
      --wa: #128C7E;
      --shadow: rgba(0, 0, 0, .4)
    }

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

    html, body {
      overflow-x: hidden;
      max-width: 100%;
    }

    body {
      background: var(--bg);
      font-family: 'Golos Text', sans-serif;
      color: var(--ink);
      min-height: 100vh;
      display: flex;
      justify-content: center;
      transition: background .2s, color .2s
    }

    #app {
      width: 100%;
      max-width: 430px;
      min-height: 100vh;
      background: var(--card);
      display: flex;
      flex-direction: column;
      box-shadow: 1px 0 0 var(--line), -1px 0 0 var(--line);
      transition: background .2s, border-color .4s;
      position: relative;
      isolation: isolate;
      border-top: 3px solid transparent;
    }

    /* ── SECTION BACKGROUNDS ────────────────────────── */

    /* Статичные разделы — тематический цветной фон */
    #s-errcode {
      background: radial-gradient(ellipse 160% 55% at 0% 0%, rgba(220,50,30,.18) 0%, transparent 65%);
    }
    #s-script {
      background: radial-gradient(ellipse 160% 55% at 0% 0%, rgba(30,90,200,.16) 0%, transparent 65%);
    }
    #s-calc {
      background: radial-gradient(ellipse 160% 55% at 0% 0%, rgba(10,155,80,.15) 0%, transparent 65%);
    }
    #s-tips {
      background: radial-gradient(ellipse 160% 55% at 0% 0%, rgba(15,148,120,.14) 0%, transparent 65%);
    }

    /* Большая иконка устройства — правый нижний угол */
    #app::after {
      content: '';
      position: absolute;
      bottom: 50px;
      right: -20px;
      width: 260px;
      height: 260px;
      background-size: contain;
      background-repeat: no-repeat;
      background-position: center;
      opacity: 0;
      z-index: -1;
      pointer-events: none;
      transition: opacity .5s, background-image .2s;
    }

    /* Стиральная машина */
    #app.ctx-wash::after {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 110'%3E%3Crect x='5' y='5' width='90' height='100' rx='10' fill='none' stroke='%23808080' stroke-width='5'/%3E%3Ccircle cx='50' cy='66' r='29' fill='none' stroke='%23808080' stroke-width='5'/%3E%3Ccircle cx='50' cy='66' r='14' fill='none' stroke='%23808080' stroke-width='3'/%3E%3Ccircle cx='22' cy='22' r='5' fill='%23808080'/%3E%3Ccircle cx='37' cy='22' r='5' fill='%23808080'/%3E%3C/svg%3E");
      opacity: .14;
    }

    /* Холодильник */
    #app.ctx-fridge::after {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 110'%3E%3Crect x='6' y='5' width='68' height='100' rx='10' fill='none' stroke='%23808080' stroke-width='5'/%3E%3Cline x1='6' y1='40' x2='74' y2='40' stroke='%23808080' stroke-width='5'/%3E%3Cline x1='30' y1='18' x2='30' y2='33' stroke='%23808080' stroke-width='4.5' stroke-linecap='round'/%3E%3Cline x1='30' y1='56' x2='30' y2='92' stroke='%23808080' stroke-width='4.5' stroke-linecap='round'/%3E%3C/svg%3E");
      opacity: .14;
    }

    /* Водонагреватель */
    #app.ctx-water::after {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 115'%3E%3Crect x='15' y='8' width='50' height='80' rx='25' fill='none' stroke='%23808080' stroke-width='5'/%3E%3Cline x1='40' y1='88' x2='40' y2='104' stroke='%23808080' stroke-width='5' stroke-linecap='round'/%3E%3Cline x1='26' y1='104' x2='54' y2='104' stroke='%23808080' stroke-width='5' stroke-linecap='round'/%3E%3Ccircle cx='40' cy='48' r='11' fill='none' stroke='%23808080' stroke-width='4'/%3E%3Cline x1='40' y1='37' x2='40' y2='8' stroke='%23808080' stroke-width='3.5' stroke-dasharray='5 4'/%3E%3C/svg%3E");
      opacity: .14;
    }

    /* Гло режима — верхний левый угол */
    #app::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      z-index: -1;
      pointer-events: none;
      opacity: 0;
      transition: opacity .4s;
    }

    /* Режим «Проверить мастера» — красный гло + красная полоска */
    #app.ctx-antiscam { border-top-color: var(--red); }
    #app.ctx-antiscam::before {
      background: radial-gradient(ellipse 180% 55% at 0% 0%, rgba(163,45,45,.15) 0%, transparent 60%);
      opacity: 1;
    }

    /* Режим «Починить самому» — зелёный гло + зелёная полоска */
    #app.ctx-diy { border-top-color: var(--teal); }
    #app.ctx-diy::before {
      background: radial-gradient(ellipse 180% 55% at 0% 0%, rgba(15,110,86,.14) 0%, transparent 60%);
      opacity: 1;
    }

    /* ── HEADER ── */
    .hdr {
      padding: 10px 14px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      gap: 6px;
      background: var(--card);
      border-bottom: 1px solid var(--line)
    }

    .btn-home, .btn-back {
      background: none;
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 5px 11px;
      font-size: 12px;
      color: var(--ink2);
      cursor: pointer;
      font-family: 'Golos Text', sans-serif;
      white-space: nowrap;
      flex-shrink: 0
    }

    .btn-home:active, .btn-back:active {
      background: var(--card2)
    }

    .logo {
      font-family: 'Unbounded', sans-serif;
      font-size: 12px;
      color: var(--ink);
      flex: 1;
      text-align: center;
      cursor: pointer;
      user-select: none;
      letter-spacing: -.2px
    }

    .btn-theme {
      background: none;
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 5px 10px;
      font-size: 11px;
      color: var(--ink2);
      cursor: pointer;
      font-family: 'Golos Text', sans-serif;
      flex-shrink: 0
    }


    .cur-sel {
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 4px 24px 4px 10px;
      font-size: 11px;
      color: var(--ink2);
      background: var(--card) url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E5D59' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right 8px center / 12px;
      font-family: 'Golos Text', sans-serif;
      cursor: pointer;
      appearance: none;
      -webkit-appearance: none;
      outline: none;
      transition: all .12s;
    }

    .cur-sel:focus {
      border-color: var(--teal-mid);
    }

    /* ── PROGRESS ── */
    .prog-wrap {
      padding: 8px 14px 0
    }

    .prog-track {
      height: 2px;
      background: var(--line);
      border-radius: 2px
    }

    .prog-fill {
      height: 2px;
      background: var(--ink);
      border-radius: 2px;
      transition: width .3s cubic-bezier(.4, 0, .2, 1)
    }

    .prog-lbl {
      font-size: 10px;
      color: var(--ink3);
      margin-top: 4px;
      letter-spacing: .2px
    }

    /* ── CONTENT ── */
    .content {
      padding: 16px 14px 24px;
      flex: 1;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch
    }

    .screen {
      display: none;
      flex-direction: column;
      animation: fi .15s ease
    }

    .screen.active {
      display: flex
    }

    @keyframes fi {
      from {
        opacity: 0;
        transform: translateY(5px)
      }

      to {
        opacity: 1;
        transform: none
      }
    }

    /* ── LABELS ── */
    .slbl {
      font-size: 10px;
      color: var(--ink3);
      text-transform: uppercase;
      letter-spacing: .6px;
      font-weight: 700;
      margin-bottom: 5px
    }

    .sh {
      font-size: 20px;
      font-weight: 700;
      line-height: 1.3;
      margin-bottom: 4px
    }

    .ssub {
      font-size: 13px;
      color: var(--ink2);
      line-height: 1.5
    }

    .crumbs {
      display: flex;
      flex-wrap: wrap;
      gap: 3px;
      margin-bottom: 12px
    }

    .crumb {
      font-size: 10px;
      color: var(--ink2);
      background: var(--card2);
      padding: 2px 8px;
      border-radius: 20px
    }

    /* ── HOME GRID ── */
    .mod-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin: 12px 0
    }

    .mod-card {
      border: 1.5px solid var(--line);
      border-radius: 12px;
      padding: 12px;
      cursor: pointer;
      background: var(--card);
      transition: all .12s;
      user-select: none;
      -webkit-user-select: none
    }

    .mod-card:active {
      transform: scale(.96);
      opacity: .88
    }

    .mod-ico {
      width: 34px;
      height: 34px;
      border-radius: 9px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      margin-bottom: 7px
    }

    .mod-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--ink);
      margin-bottom: 2px
    }

    .mod-desc {
      font-size: 11px;
      color: var(--ink2);
      line-height: 1.35
    }

    /* ── TILE PHOTO BACKGROUNDS ── */
    .mod-card[data-tile] {
      position: relative;
      overflow: hidden;
      background-size: cover;
      background-position: center;
      border-color: transparent;
      min-height: 112px
    }

    /* слой 1: белая вуаль 20% — смягчает фото, убирает тяжесть */
    .mod-card[data-tile]::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(255,255,255,.20);
      border-radius: inherit;
      z-index: 1
    }

    /* слой 2: тёмный градиент снизу — текст всегда читается */
    .mod-card[data-tile]::after {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      background: linear-gradient(
        to bottom,
        rgba(0,0,0,.00) 0%,
        rgba(0,0,0,.55) 100%
      );
      border-radius: inherit;
      z-index: 2
    }

    [data-theme="dark"] .mod-card[data-tile]::after {
      background: linear-gradient(
        to bottom,
        rgba(0,0,0,.10) 0%,
        rgba(0,0,0,.72) 100%
      )
    }

    /* lift content above both overlay layers */
    .mod-card[data-tile] .mod-ico,
    .mod-card[data-tile] .mod-title,
    .mod-card[data-tile] .mod-desc {
      position: relative;
      z-index: 3
    }

    /* frosted emoji badge */
    .mod-card[data-tile] .mod-ico {
      background: rgba(255,255,255,.20);
      -webkit-backdrop-filter: blur(6px);
      backdrop-filter: blur(6px);
      box-shadow: 0 1px 4px rgba(0,0,0,.18)
    }

    /* white text on photo */
    .mod-card[data-tile] .mod-title {
      color: #fff;
      text-shadow: 0 1px 4px rgba(0,0,0,.45)
    }

    .mod-card[data-tile] .mod-desc {
      color: rgba(255,255,255,.80);
      text-shadow: 0 1px 3px rgba(0,0,0,.40)
    }


    /* individual photo sources */
    .mod-card[data-tile="master"]  { background-image: url('../img/tiles/master.jpg') }
    .mod-card[data-tile="diy"]     { background-image: url('../img/tiles/diy.jpg') }
    .mod-card[data-tile="errcode"] { background-image: url('../img/tiles/errcode.jpg') }
    .mod-card[data-tile="script"]  { background-image: url('../img/tiles/script.jpg') }
    .mod-card[data-tile="calc"]    { background-image: url('../img/tiles/calc.jpg') }
    .mod-card[data-tile="tips"]    { background-image: url('../img/tiles/tips.jpg') }
    .mod-card[data-tile="parts"]   { background-image: url('../img/tiles/parts.jpg') }
    .mod-card[data-tile="used"]    { background-image: url('../img/tiles/used.jpg') }
    .mod-card[data-tile="buynew"]  { background-image: url('../img/tiles/buynew.jpg') }
    .mod-card[data-tile="legal"]   { background-image: url('../img/tiles/legal.jpg') }

    /* ── DEVICE CARDS ── */
    .dev-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin: 14px 0 6px
    }

    .dev-card {
      border: 1.5px solid var(--line);
      border-radius: 12px;
      padding: 14px 6px 12px;
      text-align: center;
      cursor: pointer;
      transition: all .12s;
      background: var(--card);
      user-select: none
    }

    .dev-card:active {
      transform: scale(.95)
    }

    .dev-card.sel {
      border-color: var(--teal-mid);
      background: var(--teal-bg)
    }

    .dev-card.sel .dev-name {
      color: var(--teal-dk)
    }

    .dev-ico {
      font-size: 26px;
      display: block;
      margin-bottom: 6px
    }

    .dev-name {
      font-size: 11px;
      font-weight: 600;
      color: var(--ink2);
      line-height: 1.3
    }

    /* ── MODE CARDS ── */
    .mode-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin: 12px 0
    }

    .mode-card {
      border: 1.5px solid var(--line);
      border-radius: 12px;
      padding: 12px;
      cursor: pointer;
      transition: all .12s;
      display: flex;
      gap: 10px;
      background: var(--card);
      user-select: none
    }

    .mode-card:active {
      transform: scale(.99)
    }

    .mode-card.sel {
      border-color: var(--teal-mid);
      background: var(--teal-bg)
    }

    .mode-ico {
      width: 36px;
      height: 36px;
      min-width: 36px;
      border-radius: 9px;
      background: var(--card2);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px
    }

    .mode-title {
      font-size: 14px;
      font-weight: 600;
      margin-bottom: 2px;
      color: var(--ink)
    }

    .mode-desc {
      font-size: 12px;
      color: var(--ink2);
      line-height: 1.4
    }

    /* ── INFO BOXES ── */
    .ibox {
      border-radius: 10px;
      padding: 10px 12px;
      font-size: 12px;
      line-height: 1.55;
      margin-top: 4px
    }

    .ibox.warn {
      background: var(--amber-bg);
      color: var(--amber)
    }

    .ibox.info {
      background: var(--teal-bg);
      color: var(--teal-dk)
    }

    .ibox.danger {
      background: var(--red-bg);
      color: var(--red)
    }

    /* ── QUESTIONS ── */
    .q-text {
      font-size: 16px;
      font-weight: 600;
      line-height: 1.45;
      margin-bottom: 14px
    }

    .opt-list {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-bottom: 8px
    }

    .opt {
      border: 1.5px solid var(--line);
      border-radius: 10px;
      padding: 12px 13px;
      cursor: pointer;
      font-size: 13px;
      color: var(--ink);
      background: var(--card);
      text-align: left;
      transition: all .12s;
      font-family: 'Golos Text', sans-serif;
      line-height: 1.4;
      user-select: none;
      width: 100%
    }

    .opt:active {
      transform: scale(.99)
    }

    .opt.sel {
      border-color: var(--teal-mid);
      background: var(--teal-bg);
      color: var(--teal-dk)
    }

    .opt.custom-opt {
      border-style: dashed;
      color: var(--ink3);
      font-size: 12px;
      display: flex;
      align-items: center;
      gap: 7px
    }

    .opt.custom-opt.sel {
      border-style: solid
    }

    .cta-wrap {
      display: none;
      margin-top: 4px
    }

    .cta-wrap.open {
      display: flex;
      flex-direction: column;
      gap: 6px
    }

    textarea.cta {
      width: 100%;
      border: 1.5px solid var(--teal-mid);
      border-radius: 10px;
      padding: 11px 12px;
      font-size: 13px;
      font-family: 'Golos Text', sans-serif;
      color: var(--ink);
      background: var(--card);
      resize: none;
      min-height: 72px;
      line-height: 1.5;
      outline: none
    }

    textarea.cta::placeholder {
      color: var(--ink3)
    }

    .btn-send-ai {
      align-self: flex-end;
      border: none;
      border-radius: 8px;
      background: var(--teal-mid);
      color: #fff;
      padding: 7px 14px;
      font-size: 13px;
      font-family: 'Golos Text', sans-serif;
      cursor: pointer;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 5px
    }

    .btn-send-ai span.ai-lbl {
      opacity: .7;
      font-weight: 400;
      font-size: 11px
    }

    .ai-resp {
      background: var(--card2);
      border-radius: 8px;
      padding: 10px 12px;
      font-size: 12px;
      color: var(--ink2);
      line-height: 1.6;
      font-style: italic;
      display: none
    }

    .ai-resp.show {
      display: block
    }

    /* ── BOTTOM BAR ── */
    .bottom {
      padding: 10px 14px 20px;
      flex-shrink: 0;
      background: var(--card);
      border-top: 1px solid var(--line)
    }

    .btn-p {
      width: 100%;
      padding: 13px;
      border-radius: 12px;
      border: none;
      background: var(--ink);
      color: var(--card);
      font-size: 15px;
      font-weight: 600;
      cursor: pointer;
      font-family: 'Golos Text', sans-serif;
      transition: opacity .15s;
      display: block
    }

    .btn-p:disabled {
      opacity: .25;
      cursor: default
    }

    .btn-wa-sm {
      width: 100%;
      padding: 11px;
      border-radius: 12px;
      border: none;
      background: var(--wa);
      color: #fff;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      font-family: 'Golos Text', sans-serif;
      margin-top: 7px
    }

    /* ── RESULT ── */
    .rsec {
      margin-bottom: 9px
    }

    .verdict {
      border-radius: 12px;
      padding: 13px 15px
    }

    .verdict.ok {
      background: var(--teal-bg);
      border-left: 3px solid var(--teal-mid)
    }

    .verdict.warn {
      background: var(--amber-bg);
      border-left: 3px solid var(--amber)
    }

    .verdict.danger {
      background: var(--red-bg);
      border-left: 3px solid var(--red)
    }

    .vhead {
      display: flex;
      align-items: center;
      gap: 7px;
      margin-bottom: 7px
    }

    .vico {
      width: 21px;
      height: 21px;
      min-width: 21px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      font-weight: 700
    }

    .vico.ok {
      background: var(--teal-mid);
      color: #fff
    }

    .vico.warn {
      background: var(--amber);
      color: #fff
    }

    .vico.danger {
      background: var(--red);
      color: #fff
    }

    .vtitle {
      font-size: 15px;
      font-weight: 700
    }

    .vtitle.ok {
      color: var(--teal-dk)
    }

    .vtitle.warn {
      color: var(--amber)
    }

    .vtitle.danger {
      color: var(--red)
    }

    .vbody {
      font-size: 13px;
      line-height: 1.6;
      color: var(--ink2)
    }

    .ai-lbl-hd {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .5px;
      color: var(--ink3);
      margin-bottom: 4px
    }

    .ai-box {
      background: var(--card2);
      border-radius: 12px;
      padding: 13px;
      border: 1px solid var(--line);
      font-size: 13px;
      line-height: 1.65;
      color: var(--ink);
      min-height: 50px
    }

    .ai-box.empty {
      color: var(--ink3);
      font-style: italic;
      min-height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      font-size: 12px
    }

    .edit-ta {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 8px;
      background: var(--card);
      color: var(--ink);
      font-family: inherit;
      resize: vertical;
      outline: none
    }

    .edit-ta:focus {
      border-color: var(--teal-mid)
    }

    .pulse {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--teal-mid);
      animation: p 1s infinite;
      vertical-align: middle;
      margin-right: 5px
    }

    @keyframes p {

      0%,
      100% {
        opacity: 1
      }

      50% {
        opacity: .25
      }
    }

    .pcard {
      background: var(--card2);
      border-radius: 12px;
      overflow: hidden;
      border: 1px solid var(--line)
    }

    .pchead {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .5px;
      color: var(--ink3);
      padding: 8px 13px 4px
    }

    .prow {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 7px 13px;
      border-top: 1px solid var(--line);
      font-size: 13px;
      gap: 7px
    }

    .pl {
      color: var(--ink2);
      flex: 1;
      font-size: 12px
    }

    .pv {
      font-weight: 600;
      white-space: nowrap
    }

    .pv.ok {
      color: var(--teal)
    }

    .pv.warn {
      color: var(--amber)
    }

    .pv.danger {
      color: var(--red)
    }

    .flags-card {
      background: var(--red-bg);
      border-radius: 12px;
      padding: 12px 13px
    }

    .fhead {
      font-size: 12px;
      font-weight: 700;
      color: var(--red);
      margin-bottom: 7px
    }

    .flag {
      font-size: 12px;
      color: var(--ink2);
      padding: 4px 0 4px 17px;
      line-height: 1.5;
      position: relative;
      border-top: 1px solid var(--line)
    }

    .flag:first-of-type {
      border: none
    }

    .flag::before {
      content: "→";
      position: absolute;
      left: 0;
      color: var(--red);
      font-weight: 700
    }

    .flag a {
      color: var(--teal-dk);
      text-decoration: underline;
      cursor: pointer
    }

    .diy-card {
      background: var(--teal-bg);
      border-radius: 12px;
      padding: 12px 13px
    }

    .dhead {
      font-size: 14px;
      font-weight: 700;
      color: var(--teal);
      margin-bottom: 5px
    }

    .dbadge {
      display: inline-block;
      font-size: 10px;
      padding: 2px 9px;
      border-radius: 20px;
      background: var(--teal-mid);
      color: #fff;
      margin-bottom: 8px;
      font-weight: 700
    }

    .dstep {
      font-size: 12px;
      color: var(--ink2);
      padding: 5px 0 5px 22px;
      line-height: 1.5;
      position: relative;
      border-top: 1px solid rgba(255, 255, 255, .25)
    }

    .dstep:first-of-type {
      border: none
    }

    .dnum {
      position: absolute;
      left: 0;
      font-weight: 700;
      color: var(--teal-mid);
      font-size: 11px;
      top: 6px
    }

    .tool-card {
      background: var(--card2);
      border-radius: 12px;
      overflow: hidden;
      border: 1px solid var(--line)
    }

    .tool-verdict {
      padding: 9px 13px;
      font-size: 13px;
      font-weight: 600;
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      gap: 5px
    }

    .tv-ok {
      color: var(--teal)
    }

    .tv-warn {
      color: var(--amber)
    }

    .yt-row {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 9px 13px;
      border-top: 1px solid var(--line)
    }

    .yt-ico {
      width: 22px;
      height: 22px;
      min-width: 22px;
      background: #FF0000;
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center
    }

    .yt-link {
      font-size: 12px;
      color: var(--teal-dk);
      text-decoration: none;
      line-height: 1.3
    }

    .photo-card {
      background: var(--card2);
      border-radius: 12px;
      padding: 12px 13px;
      border: 1px solid var(--line)
    }

    .photo-head {
      font-size: 12px;
      font-weight: 700;
      color: var(--ink2);
      margin-bottom: 8px
    }

    .photo-btns {
      display: flex;
      flex-direction: column;
      gap: 5px
    }

    .btn-photo {
      border: 1.5px solid var(--line);
      border-radius: 9px;
      padding: 9px 13px;
      font-size: 13px;
      font-family: 'Golos Text', sans-serif;
      cursor: pointer;
      text-align: left;
      display: flex;
      align-items: center;
      gap: 7px;
      background: var(--card);
      color: var(--ink)
    }

    /* ── MODULE SCREENS ── */
    .ec-row {
      background: var(--card2);
      border-radius: 9px;
      padding: 9px 12px;
      margin-bottom: 6px;
      border: 1px solid var(--line)
    }

    .ec-code {
      font-family: monospace;
      font-size: 14px;
      font-weight: 700;
      color: var(--teal);
      margin-bottom: 2px
    }

    .ec-meaning {
      font-size: 13px;
      font-weight: 600;
      color: var(--ink);
      margin-bottom: 2px
    }

    .ec-likely {
      font-size: 12px;
      color: var(--ink2);
      line-height: 1.4
    }

    .ec-diy {
      display: inline-block;
      font-size: 10px;
      padding: 2px 7px;
      border-radius: 20px;
      margin-top: 3px
    }

    .ec-diy.yes {
      background: var(--teal-bg);
      color: var(--teal-dk)
    }

    .ec-diy.no {
      background: var(--red-bg);
      color: var(--red)
    }

    .ec-warn {
      font-size: 11px;
      color: var(--red);
      margin-top: 3px
    }

    .ec-link {
      font-size: 11px;
      color: var(--teal-dk);
      text-decoration: underline;
      cursor: pointer;
      margin-left: 5px
    }

    .sc-intro {
      background: var(--amber-bg);
      border-radius: 9px;
      padding: 9px 12px;
      font-size: 12px;
      color: var(--amber);
      margin-bottom: 9px;
      line-height: 1.5
    }

    .sc-q {
      background: var(--card2);
      border-radius: 9px;
      padding: 10px 12px;
      margin-bottom: 6px;
      border: 1px solid var(--line)
    }

    .sc-qt {
      font-size: 13px;
      font-weight: 600;
      color: var(--ink);
      margin-bottom: 5px
    }

    .sc-good {
      font-size: 12px;
      color: var(--teal-dk);
      padding: 2px 0;
      line-height: 1.5
    }

    .sc-bad {
      font-size: 12px;
      color: var(--red);
      padding: 2px 0;
      line-height: 1.5
    }

    .sc-phrases {
      background: var(--red-bg);
      border-radius: 9px;
      padding: 10px 12px;
      margin-top: 4px
    }

    .sc-ph-hd {
      font-size: 12px;
      font-weight: 700;
      color: var(--red);
      margin-bottom: 6px
    }

    .sc-phrase {
      font-size: 12px;
      color: var(--ink2);
      padding: 3px 0 3px 15px;
      line-height: 1.4;
      position: relative
    }

    .sc-phrase::before {
      content: "✕";
      position: absolute;
      left: 0;
      color: var(--red);
      font-size: 10px;
      top: 4px
    }

    .ca-verdict {
      border-radius: 12px;
      padding: 13px 15px;
      margin-bottom: 8px
    }

    .ca-verdict.ok {
      background: var(--teal-bg);
      border-left: 3px solid var(--teal-mid)
    }

    .ca-verdict.warn {
      background: var(--amber-bg);
      border-left: 3px solid var(--amber)
    }

    .ca-verdict.danger {
      background: var(--red-bg);
      border-left: 3px solid var(--red)
    }

    .ca-title {
      font-size: 15px;
      font-weight: 700;
      margin-bottom: 5px
    }

    .ca-title.ok {
      color: var(--teal-dk)
    }

    .ca-title.warn {
      color: var(--amber)
    }

    .ca-title.danger {
      color: var(--red)
    }

    .ca-body {
      font-size: 13px;
      color: var(--ink2);
      line-height: 1.6
    }

    .tip-card {
      border-radius: 12px;
      padding: 11px 13px;
      margin-bottom: 7px;
      background: var(--card2);
      border: 1px solid var(--line)
    }

    .tip-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--ink);
      margin-bottom: 4px
    }

    .tip-text {
      font-size: 12px;
      color: var(--ink2);
      line-height: 1.6
    }

    /* ── WA SHEET ── */
    .ov {
      display: none;
      position: absolute;
      inset: 0;
      background: rgba(0, 0, 0, .5);
      z-index: 50;
      flex-direction: column;
      justify-content: flex-end
    }

    .ov.open {
      display: flex
    }

    .sheet {
      background: var(--card);
      border-radius: 16px 16px 0 0;
      padding: 18px 14px 26px;
      animation: su .18s ease;
      max-height: 85vh;
      overflow-y: auto
    }

    @keyframes su {
      from {
        transform: translateY(100%)
      }

      to {
        transform: none
      }
    }

    .sheet-h {
      font-size: 16px;
      font-weight: 700;
      margin-bottom: 5px
    }

    .sheet-sub {
      font-size: 13px;
      color: var(--ink2);
      margin-bottom: 10px;
      line-height: 1.5
    }

    .cond-badge {
      display: inline-block;
      font-size: 11px;
      padding: 3px 11px;
      border-radius: 20px;
      background: var(--amber-bg);
      color: var(--amber);
      font-weight: 600;
      margin-bottom: 9px
    }

    .preview {
      background: var(--card2);
      border-radius: 9px;
      padding: 10px 12px;
      font-size: 11px;
      color: var(--ink2);
      line-height: 1.7;
      margin-bottom: 9px;
      border: 1px solid var(--line);
      white-space: pre-wrap;
      font-family: monospace;
      max-height: 110px;
      overflow-y: auto
    }

    textarea.sheet-ta {
      width: 100%;
      border: 1.5px solid var(--line);
      border-radius: 9px;
      padding: 9px 11px;
      font-size: 13px;
      font-family: 'Golos Text', sans-serif;
      color: var(--ink);
      background: var(--card);
      resize: none;
      height: 62px;
      outline: none;
      margin-bottom: 9px
    }

    textarea.sheet-ta:focus {
      border-color: var(--teal-mid)
    }

    .btn-wa-full {
      width: 30%;
      height: 50px;
      padding: 12px;
      border-radius: 12px;
      border: none;
      background: var(--wa);
      color: #fff;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      font-family: 'Golos Text', sans-serif;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      margin-bottom: 6px
    }

    .btn-cancel {
      width: 100%;
      padding: 10px;
      border-radius: 12px;
      border: 1.5px solid var(--line);
      background: transparent;
      color: var(--ink2);
      font-size: 13px;
      cursor: pointer;
      font-family: 'Golos Text', sans-serif
    }

    /* ── ADMIN ── */
    .admin-section {
      border-top: 1px solid var(--line);
      display: none;
      flex-direction: column;
      background: var(--card2)
    }

    .admin-section.open {
      display: flex
    }

    .admin-inner {
      padding: 14px;
      display: flex;
      flex-direction: column;
      gap: 11px
    }

    .adm-sec {
      font-size: 10px;
      color: var(--ink3);
      text-transform: uppercase;
      letter-spacing: .5px;
      font-weight: 700;
      padding-top: 3px
    }

    .adm-lbl {
      font-size: 13px;
      color: var(--ink2);
      margin-bottom: 2px
    }

    .adm-inp {
      border: 1.5px solid var(--line);
      border-radius: 8px;
      padding: 8px 11px;
      font-size: 13px;
      font-family: 'Golos Text', sans-serif;
      color: var(--ink);
      background: var(--card);
      outline: none;
      width: 100%;
      transition: border-color .15s
    }

    .adm-inp:focus {
      border-color: var(--teal-mid)
    }

    .adm-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 7px
    }

    .btn-adm-save {
      padding: 11px 18px;
      border-radius: 9px;
      border: none;
      background: var(--ink);
      color: var(--card);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      font-family: 'Golos Text', sans-serif
    }

    .adm-saved {
      font-size: 12px;
      color: var(--teal);
      display: none;
      align-self: center
    }

    .kb-ext-list {
      display: flex;
      flex-direction: column;
      gap: 4px;
      margin-top: 3px
    }

    .kb-ext-item {
      background: var(--card);
      border-radius: 7px;
      padding: 7px 11px;
      font-size: 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 7px;
      border: 1px solid var(--line)
    }

    .kb-ext-lbl {
      color: var(--ink2);
      flex: 1
    }

    .kb-ext-del {
      background: none;
      border: none;
      font-size: 16px;
      color: var(--ink3);
      cursor: pointer;
      padding: 0;
      line-height: 1
    }

    /* ── TG BANNER ── */
    .tg-banner {
      background: var(--teal-bg);
      border-radius: 12px;
      padding: 12px 13px;
      border: 1px solid var(--teal-mid);
      display: flex;
      gap: 9px;
      align-items: center;
      cursor: pointer;
      margin-bottom: 3px
    }

    .tg-ico {
      width: 38px;
      height: 38px;
      min-width: 38px;
      border-radius: 9px;
      background: #26A5E4;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 19px
    }

    .tg-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--teal-dk)
    }

    .tg-sub {
      font-size: 11px;
      color: var(--ink2)
    }

    @media(min-width:430px) {
      #app {
        box-shadow: 0 0 0 1px var(--line)
      }
    }

    /* ══ PHOTO THEME ═══════════════════════════════════════════ */

    /* Слой с фотографией */
    #bg-photo {
      display: none;
      position: absolute;
      top: -5%; left: -5%; right: -5%; bottom: -5%;
      background-size: cover;
      background-position: center;
      filter: blur(2px);
      z-index: -1;
      pointer-events: none;
      transition: background-image .5s ease;
    }

    [data-theme="photo"] #bg-photo { display: block; }

    /* Обрезаем размытые края */
    [data-theme="photo"] #app { overflow: hidden; }

    /* Переменные — прозрачные карточки */
    [data-theme="photo"] {
      --card: rgba(255,255,255,.66);
      --card2: rgba(234,234,227,.70);
      --line: rgba(216,215,208,.55);
      --shadow: rgba(0,0,0,.14);
      --teal-bg: rgba(212,238,229,.72);
      --red-bg: rgba(250,234,234,.72);
      --amber-bg: rgba(240,221,184,.72);
      --info-bg: rgba(230,241,251,.72);
    }

    /* Стеклянный эффект на всех блоках */
    [data-theme="photo"] .mod-card,
    [data-theme="photo"] .dev-card,
    [data-theme="photo"] .mode-card,
    [data-theme="photo"] .opt,
    [data-theme="photo"] .cur-sel,
    [data-theme="photo"] .tool-card,
    [data-theme="photo"] .hdr,
    [data-theme="photo"] .prog-wrap {
      -webkit-backdrop-filter: blur(10px);
      backdrop-filter: blur(10px);
    }

    /* Отключаем фоны экранов — фото даёт контекст */
    [data-theme="photo"] #s-errcode,
    [data-theme="photo"] #s-script,
    [data-theme="photo"] #s-calc,
    [data-theme="photo"] #s-tips { background: none; }

    /* Убираем SVG-оверлеи режима/устройства (фото их заменяет) */
    [data-theme="photo"] #app::before,
    [data-theme="photo"] #app::after { opacity: 0 !important; }

    /* Цветная полоска режима остаётся */
    [data-theme="photo"] #app.ctx-antiscam { border-top-color: var(--red); }
    [data-theme="photo"] #app.ctx-diy { border-top-color: var(--teal); }

    /* ── TEXT READABILITY IN PHOTO THEME ──────────────────────────
       Pill-фон на заголовках и подзаголовках — текст читается
       на любой фотографии, светлой или тёмной               */

    /* Единый контейнер заголовка экрана — один фон, по центру */
    [data-theme="photo"] .screen-hd {
      display: table;
      margin: 0 auto 10px;
      background: rgba(255,255,255,.84);
      -webkit-backdrop-filter: blur(10px);
      backdrop-filter: blur(10px);
      border-radius: 18px;
      padding: 6px 20px 8px;
      text-align: center
    }

    /* Внутри screen-hd — убираем индивидуальные фоны */
    [data-theme="photo"] .screen-hd .slbl,
    [data-theme="photo"] .screen-hd .sh {
      display: block;
      background: none !important;
      -webkit-backdrop-filter: none !important;
      backdrop-filter: none !important;
      border-radius: 0;
      padding: 0;
      margin: 0;
      width: auto
    }

    /* Текст вопроса в диагностике */
    [data-theme="photo"] .q-text {
      background: rgba(255,255,255,.80);
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
      border-radius: 16px;
      padding: 8px 14px;
      color: var(--ink)
    }

    /* Текст результата и секций */
    [data-theme="photo"] .rsec {
      background: rgba(255,255,255,.72);
      -webkit-backdrop-filter: blur(10px);
      backdrop-filter: blur(10px);
      border-radius: 14px;
      border-color: rgba(216,215,208,.40)
    }

    /* Хлебные крошки */
    [data-theme="photo"] .crumbs {
      background: rgba(255,255,255,.70);
      -webkit-backdrop-filter: blur(6px);
      backdrop-filter: blur(6px);
      border-radius: 12px;
      padding: 4px 10px;
      width: fit-content
    }

    /* Карточки опций (ответов) */
    [data-theme="photo"] .opt {
      background: rgba(255,255,255,.74) !important;
    }

    /* Маленький лейбл над заголовком */
    [data-theme="photo"] .slbl {
      display: inline-block;
      background: rgba(255,255,255,.60);
      -webkit-backdrop-filter: blur(6px);
      backdrop-filter: blur(6px);
      border-radius: 10px;
      padding: 1px 10px;
      color: var(--ink3)
    }

    /* Контейнеры динамического контента */
    [data-theme="photo"] #parts-body,
    [data-theme="photo"] #used-body,
    [data-theme="photo"] #buynew-body,
    [data-theme="photo"] #legal-body,
    [data-theme="photo"] #master-hub-body,
    [data-theme="photo"] #master-guide-body,
    [data-theme="photo"] #master-warranty-body,
    [data-theme="photo"] #ec-list,
    [data-theme="photo"] #sc-body,
    [data-theme="photo"] #ca-result,
    [data-theme="photo"] #tp-body {
      background: rgba(255,255,255,.76);
      -webkit-backdrop-filter: blur(12px);
      backdrop-filter: blur(12px);
      border-radius: 16px;
      padding: 4px 12px 8px
    }

    /* Лейблы формы калькулятора */
    [data-theme="photo"] .adm-lbl {
      display: inline-block;
      background: rgba(255,255,255,.65);
      -webkit-backdrop-filter: blur(4px);
      backdrop-filter: blur(4px);
      border-radius: 8px;
      padding: 1px 8px;
      font-size: 12px
    }

    /* Select и input в photo-теме */
    [data-theme="photo"] select,
    [data-theme="photo"] input[type="text"],
    [data-theme="photo"] input[type="number"] {
      background: rgba(255,255,255,.82) !important;
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px)
    }