/* ─── Responsive ─── */
    /* Collapsible cards — chevron always at far right, vertically centered */
    .settings-accordion > .card-title,
    .collapsible-card > .card-title{
      cursor:pointer;user-select:none;
      display:grid;
      grid-template-columns:minmax(0,1fr) auto auto;
      align-items:center;
      column-gap:10px;
      width:100%;
      box-sizing:border-box;
      min-height:28px;
    }
    .settings-accordion > .card-title .collapsible-title-text,
    .collapsible-card > .card-title .collapsible-title-text{
      grid-column:1;min-width:0;justify-self:start;
    }
    .collapsible-meta{
      grid-column:2;justify-self:end;min-width:0;max-width:min(58vw,240px);
      margin:0;padding:0;
      text-align:right;font-size:13px;font-weight:400;color:var(--text-2);
      white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
    }
    .settings-accordion > .card-title::after,
    .collapsible-card > .card-title::after{
      content:"";
      grid-column:3;justify-self:end;align-self:center;
      width:8px;height:8px;margin:0;flex:0 0 auto;
      border-right:2px solid var(--text-3);border-bottom:2px solid var(--text-3);
      transform:rotate(-45deg); /* › right when collapsed */
      transition:transform .15s ease;opacity:.75;
    }
    /* when no meta, still park chevron in last column */
    .settings-accordion > .card-title:not(:has(.collapsible-meta))::after,
    .collapsible-card > .card-title:not(:has(.collapsible-meta))::after{
      grid-column:3;
    }
    .settings-accordion.collapsed > .card-title,
    .collapsible-card.collapsed > .card-title{margin-bottom:0!important}
    .settings-accordion:not(.collapsed) > .card-title::after,
    .collapsible-card:not(.collapsed) > .card-title::after{
      transform:rotate(45deg); /* expanded: point down */
    }
    .settings-accordion.collapsed > .card-title ~ *,
    .collapsible-card.collapsed > .card-title ~ *{display:none!important}
    .collapsible-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:-4px 0 14px}

    @media(max-width:640px){
      html,body{width:100%;max-width:100%;overflow-x:hidden}
      body{min-height:100dvh;overflow:hidden}
      .app{height:100dvh;max-width:100%;overflow:hidden}
      .topbar{height:auto;min-height:52px;padding:8px 12px;gap:8px;flex-wrap:nowrap}
      .topbar-logo{font-size:17px;flex-shrink:0}
      .topbar-right{margin-left:auto;gap:6px;flex-wrap:nowrap;justify-content:flex-end}
      .alert-bell-btn,.prefs-btn{width:34px;height:34px}
      .topbar-logout-btn{height:34px;min-height:34px;padding:0 10px;font-size:12px;border-radius:10px}
      .page-scroll{padding:12px 0 calc(76px + env(safe-area-inset-bottom));overflow-x:hidden}
      .page-inner{max-width:100%;padding:0 12px;overflow-x:hidden}
      .card{padding:14px 12px;border-radius:var(--r-sm);margin-bottom:12px;max-width:100%;overflow:hidden}
      .card[style]{padding:14px 12px!important}
      .card-title{font-size:18px;margin-bottom:12px}
      .grid-2,.ts-kind-grid,.ts-local-grid,.ts-cloud-list{grid-template-columns:1fr;gap:8px}
      .field-inline{flex-wrap:wrap}
      .ts-key-field,#v-settings .ts-key-field{min-height:40px;height:40px}
      .ts-key-field .inp,#v-settings .ts-key-field .inp{line-height:38px}
      .ts-key-clear{min-height:28px;height:28px;max-height:28px;padding:0 10px}
      .ts-cloud-name{flex:0 1 auto}
      .ts-cloud-row{min-height:40px;padding:4px 6px}
      .ts-cloud-move button{width:32px;height:32px;min-height:32px;max-height:32px}
      .platform-tag-editor{margin:-6px 0 14px}
      .platform-tag-controls .btn{min-height:36px}
      /* stats: 2x2 cards, pills stay 4 columns */
      .stats,#v-results .stats{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-bottom:12px}
      #v-results .stat-box,.stat-box{padding:10px 10px 8px}
      #v-results .stat-val,.stat-val{font-size:24px}
      #v-results .stat-label,.stat-label{font-size:11px;margin-bottom:4px}
      #v-results .stat-sub,.stat-sub{margin-top:5px;gap:3px;grid-template-columns:repeat(4,minmax(0,1fr))}
      #v-results .stat-chip,.stat-chip{padding:1px 4px;font-size:10px}
      .topbar-nav{display:none}
      .pill-tabs{max-height:160px;overflow-y:auto;align-content:flex-start;margin-bottom:12px;padding:3px;gap:3px}
      .pill{min-height:34px;padding:7px 10px;font-size:12px;flex:1 1 calc(50% - 3px)}
      #v-register .pill-tabs{padding:3px;gap:4px;flex-direction:column;flex-wrap:nowrap;overflow:visible;max-height:none;align-items:stretch}
      #v-register .pill{flex:0 0 auto;min-height:34px;padding:7px 10px;font-size:12px}
      .mobile-platform-controls{display:grid;grid-template-columns:1fr;gap:8px;margin-bottom:12px}
      .inp,select.inp,textarea.inp,.nice-select-btn{min-height:40px;font-size:16px;max-width:100%}
      #v-results .toolbar .nice-select-btn{min-height:36px;height:auto;font-size:16px}
      .pager .nice-select-btn{min-height:30px;height:30px;font-size:13px}
      .btn,.btn-sm,#scrollLockBtn{min-width:40px;min-height:40px}
      .actions,.toolbar,.toolbar-left,.pager{flex-wrap:wrap}
      .actions{gap:8px;margin-top:14px;padding-top:12px}
      .actions .btn,.toolbar .btn{flex:1 1 auto;font-size:12px;padding:8px 10px}
      .toolbar{align-items:stretch;gap:8px;margin-bottom:10px}
      .toolbar-left{width:100%}
      .toolbar-left .inp,.toolbar-left .nice-select{flex:1 1 120px;width:auto!important}
      .toolbar>div:last-child{display:flex;flex-wrap:wrap;width:100%;gap:6px}
      #v-results .toolbar .btn,#v-results .toolbar .btn-sm{min-height:36px;padding:6px 10px}
      .export-menu{flex:1 1 auto}
      .export-menu > .btn{width:100%}
      .copy-menu{flex:0 0 auto}
      .copy-menu > .btn{width:auto}
      #v-results .result-balance-refresh.btn.btn-sm,
      .result-balance-refresh{min-width:24px;min-height:24px;width:24px;padding:2px}
      .export-menu-item{min-height:36px;padding:8px 10px}
      .mobile-filter-trigger{display:inline-flex}
      .tbl-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
      #v-results .tbl-wrap{display:none}
      .result-cards{display:grid;gap:10px;margin-top:10px}
      .result-card{
        background:var(--bg-card);border:1px solid var(--border);border-radius:var(--r-sm);
        padding:12px;box-shadow:var(--shadow);max-width:100%;min-width:0;
        overflow-wrap:anywhere;word-break:break-word;
      }
      .result-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;min-width:0;max-width:100%}
      .result-card-title{display:flex;align-items:center;gap:8px;flex:1 1 auto;min-width:0;max-width:100%;min-height:auto;flex-wrap:wrap}
      .result-card-title .result-check{
        flex:0 0 16px;width:16px;height:16px;min-width:16px;min-height:16px;
        margin:0;
      }
      .result-card-copy{flex:0 0 auto;min-width:auto;min-height:34px;padding:6px 12px;white-space:nowrap;font-size:12px}
      .mobile-result-push{display:flex;align-items:center;justify-content:flex-start;gap:4px;flex:1 1 100%;min-width:0;max-width:100%;flex-wrap:wrap}
      .result-field .result-balance-cell{width:max-content;justify-content:flex-start}
      .result-card-main{display:grid;gap:8px;margin-top:8px;min-width:0;max-width:100%}
      .result-field{display:grid;grid-template-columns:minmax(56px,auto) minmax(0,1fr);align-items:start;gap:8px;min-width:0;max-width:100%}
      .result-label{color:var(--text-3);font-size:11px;font-weight:600;line-height:1.4;text-transform:uppercase;min-width:0;max-width:100%;overflow-wrap:anywhere;word-break:break-word}
      .result-value{color:var(--text);font-size:13px;line-height:1.45;min-width:0;max-width:100%;overflow-wrap:anywhere;word-break:break-word}
      .results-select-row{margin:8px 0}
      .bottom-sheet{position:fixed;inset:0;z-index:500;display:block;pointer-events:none;background:transparent;transition:background .2s ease}
      .bottom-sheet.open{pointer-events:auto;background:var(--mask)}
      .bottom-sheet-panel{position:absolute;left:0;right:0;bottom:0;max-height:80dvh;overflow-y:auto;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--r) var(--r) 0 0;box-shadow:var(--shadow-lg);padding:16px 16px calc(16px + env(safe-area-inset-bottom));transform:translateY(100%);transition:transform .2s cubic-bezier(.16,1,.3,1)}
      .bottom-sheet.open .bottom-sheet-panel{transform:translateY(0)}
      .bottom-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;font-weight:600}
      .bottom-sheet-body{display:grid;gap:12px}
      .settings-group{margin-bottom:0}
      .settings-accordion{padding-top:0}
      /* Keep grid chevron layout on mobile. Bare flex was parking › next to the label. */
      .settings-accordion > .card-title,
      .collapsible-card > .card-title{
        margin-bottom:14px;
        min-height:44px;
        display:grid !important;
        grid-template-columns:minmax(0,1fr) auto auto;
        align-items:center;
        column-gap:10px;
        width:100%;
        box-sizing:border-box;
      }
      .settings-accordion > .card-title .collapsible-title-text,
      .collapsible-card > .card-title .collapsible-title-text{
        grid-column:1;
        min-width:0;
        justify-self:start;
      }
      .settings-accordion > .card-title .collapsible-meta,
      .collapsible-card > .card-title .collapsible-meta{
        grid-column:2;
        justify-self:end;
      }
      .settings-accordion > .card-title::after,
      .collapsible-card > .card-title::after{
        content:"";
        grid-column:3;
        justify-self:end;
        align-self:center;
        width:8px;height:8px;
        margin:0;
        flex:0 0 auto;
      }
      .push-config .push-title{font-size:13px;font-weight:700;color:var(--text);margin-bottom:10px}
      #v-settings .card.settings-accordion{padding:14px 12px}

      /* theme-aware bottom nav */
      .mobile-bottom-nav{
        position:fixed;left:0;right:0;bottom:0;z-index:300;
        display:grid;grid-template-columns:repeat(5,1fr);gap:4px;
        padding:6px 6px calc(6px + env(safe-area-inset-bottom));
        background:var(--topbar-bg);border-top:1px solid var(--border);
        backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
      }
      .mobile-bottom-nav button{
        min-height:40px;border:0;border-radius:10px;background:transparent;
        color:var(--text-2);font-family:var(--font);font-size:12px;font-weight:600;cursor:pointer;
      }
      .mobile-bottom-nav button.on,
      .mobile-bottom-nav button:focus-visible{
        background:var(--bg-card);color:var(--text);outline:none;
        box-shadow:0 1px 3px rgba(0,0,0,.12);
      }
      html[data-theme="dark"] .mobile-bottom-nav button.on{
        background:var(--bg-input);box-shadow:0 1px 3px rgba(0,0,0,.35);
      }
      .log-fab{right:12px;bottom:calc(72px + env(safe-area-inset-bottom));width:42px;height:42px}
      .version-tag{display:none}
      .log-drawer{left:12px;right:12px;bottom:calc(128px + env(safe-area-inset-bottom));width:auto;height:min(420px,58dvh);max-width:calc(100vw - 24px)}
      .log-drawer.open{opacity:1;pointer-events:auto;transform:translateY(0)}
      .log-drawer-head{gap:8px;align-items:flex-start}
      .log-drawer-head>div{flex-wrap:wrap;justify-content:flex-end}
      #toast{max-width:calc(100vw - 24px);white-space:normal;text-align:center}
      .prefs-panel{right:0;width:min(240px,calc(100vw - 24px))}
      .collapsible-toolbar{margin-top:0}
      .solver-status-head{display:none} /* legacy */
    }


    :is(.push-trio,.g2a-push-trio){
      display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
      gap:8px 16px;margin-top:10px;padding-top:10px;
      border-top:1px solid var(--border);
    }
    :is(.push-trio,.g2a-push-trio) > .push-config{border-top:none;margin:0;padding:0;min-width:0}
    :is(.push-trio,.g2a-push-trio) > .push-config + .push-config{padding-left:16px;border-left:1px solid var(--border)}
    :is(.push-trio,.g2a-push-trio) .push-title{margin-bottom:6px;font-size:12px}
    :is(.push-trio,.g2a-push-trio) .grid-2{grid-template-columns:1fr;gap:8px}
    :is(.push-trio,.g2a-push-trio) .field{margin-bottom:6px}
    .push-trio.push-trio-duo{grid-template-columns:repeat(2,minmax(0,1fr))}
    /* Grok 风控说明：三列里略收字号/行距，不改文案 */
    .push-trio .push-hint{
      margin-bottom:0;opacity:.75;font-size:11px;line-height:1.35;color:var(--text-2);
    }
    .push-key-wrap{display:flex;align-items:stretch;gap:6px;width:100%;min-width:0}
    @media(max-width:860px){
      :is(.push-trio,.g2a-push-trio){grid-template-columns:1fr;gap:12px}
      :is(.push-trio,.g2a-push-trio) > .push-config + .push-config{padding-left:0;border-left:none;padding-top:12px;border-top:1px solid var(--border)}
    }
    /* 设置页 GPT-Load 与 kiro.rs：桌面两列并排，窄屏再上下叠 */
    .push-duo{
      display:grid;
      grid-template-columns:repeat(2,minmax(0,1fr));
      gap:12px 16px;
      margin:0;
      padding:0;
    }
    .push-duo > .push-config{
      border-top:none;
      margin:0;
      padding:0;
      min-width:0;
    }
    #v-settings .push-duo > .push-config{margin-top:0;padding-top:0}
    #v-settings .push-duo + .push-duo{
      margin-top:10px;padding-top:10px;border-top:1px solid var(--border);
    }
    .push-target-cards{display:flex;flex-direction:column;gap:0;margin:0 0 2px;border:1px solid var(--border);border-radius:8px;overflow:hidden}
    .push-target-cards:empty{display:none;border:0}
    .push-target-card{border:0;border-radius:0;padding:6px 8px;display:flex;flex-direction:column;gap:6px}
    .push-target-card + .push-target-card{border-top:1px solid var(--border)}
    .push-inst-row-id{display:grid;grid-template-columns:minmax(5.5em,7.5em) minmax(0,1fr);gap:6px 8px;align-items:end}
    /* #v-settings .field {margin-bottom:10px} beats a class-only reset and lifts
       the inline key field above 测试连接/复制/删除. Scope the zero here. */
    #v-settings .push-target-card .field{margin-bottom:0}
    .push-inst-row-secret{display:flex;align-items:center;gap:6px 8px;min-width:0;flex-wrap:nowrap}
    .push-inst-user{flex:1 1 10em;min-width:0}
    .push-inst-secret{flex:1 1 auto;min-width:0}
    .push-inst-inline{display:flex;align-items:center;gap:6px;min-width:0;margin:0}
    .push-inst-inline > .inp{flex:1 1 auto;min-width:0;width:auto}
    #v-settings .push-target-card .field.push-inst-inline{
      display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;margin:0;
    }
    #v-settings .push-target-card .field.push-inst-inline > label{
      display:inline-flex;align-items:center;
      flex:0 0 auto;margin:0;white-space:nowrap;line-height:1;
    }
    /* grok2api: user + pass + 测试/复制/删除 stay one desktop scan-line. */
    .push-inst-row-secret.is-g2a{
      display:grid;
      grid-template-columns:minmax(0,1fr) minmax(0,1fr) max-content max-content;
      align-items:center;
      min-width:0;
    }
    .push-inst-row-secret.is-g2a .push-inst-user,
    .push-inst-row-secret.is-g2a .push-inst-secret{min-width:0;width:auto;flex:none}
    .push-inst-row-secret .push-test-btn,
    .push-inst-row-secret .push-target-actions,
    .push-inst-row-secret .push-target-actions .btn{
      flex:none;min-width:max-content;white-space:nowrap;
    }
    .push-inst-row-secret.is-g2a > .push-test-btn,
    .push-inst-row-secret.is-g2a > .push-target-actions{
      align-self:center;
    }
    #v-settings .push-target-card .push-inst-row-secret > .field,
    #v-settings .push-target-card .push-inst-row-secret > .push-test-btn,
    #v-settings .push-target-card .push-inst-row-secret > .push-target-actions{
      margin:0;align-self:center;
    }
    #v-settings .push-target-card .field:not(.push-inst-inline) label{margin-bottom:2px;font-size:11px}
    #v-settings .push-target-card .inp{
      flex:1 1 auto;min-width:0;
      height:36px;min-height:36px;max-height:36px;
      box-sizing:border-box;padding:0 10px;
      font-size:13px;line-height:36px;
    }
    /* 测试连接 is .btn-outline (inherits .btn min-height:44px); 复制/删除 are
       .btn-ghost.btn-sm. One rule so all three share the 36px input band. */
    #v-settings .push-target-card .push-inst-row-secret > .btn,
    #v-settings .push-target-card .push-inst-row-secret .push-target-actions .btn{
      height:36px;min-height:36px;max-height:36px;
      padding:0 10px;box-sizing:border-box;margin:0;
      font-size:12px;font-weight:500;line-height:1;white-space:nowrap;
      display:inline-flex;align-items:center;justify-content:center;
    }
    .push-test-btn,
    #v-settings .push-test-btn{
      flex:0 0 auto;
      height:36px;min-height:36px;max-height:36px;
      padding:0 10px;box-sizing:border-box;
      font-size:12px;line-height:1;white-space:nowrap;
      margin:0;border-radius:var(--r-sm);
      display:inline-flex;align-items:center;justify-content:center;
    }
    .push-target-actions{display:flex;align-items:center;gap:6px;margin:0;flex:0 0 auto}
    #v-settings .push-target-card .btn-ghost,
    #v-settings .push-add-inst,
    .push-add-inst{
      display:inline-flex;align-items:center;justify-content:center;
      height:36px;min-height:36px;max-height:36px;
      padding:0 10px;box-sizing:border-box;margin:0;
      font-size:12px;font-weight:500;line-height:1;white-space:nowrap;
      border:1px solid var(--border);border-radius:var(--r-sm);
      background:var(--bg-card);color:var(--text);
    }
    #v-settings .push-target-card .btn-ghost:hover,
    #v-settings .push-add-inst:hover{
      border-color:var(--border-hover);background:var(--bg-hover);color:var(--text);
    }
    #v-settings .push-target-actions .btn:last-child{color:var(--error)}
    #v-settings .push-target-actions .btn:last-child:hover{
      color:var(--error);background:var(--error-bg);border-color:var(--border-hover);
    }
    #v-settings .push-add-inst,
    .push-add-inst{
      align-self:flex-start;width:auto;margin:6px 0 0;
    }
    .push-inst-field{margin:0 0 8px}
    @media(max-width:720px){
      .push-duo{grid-template-columns:1fr;gap:12px}
      .push-duo > .push-config + .push-config{padding-top:12px;border-top:1px solid var(--border)}
      .push-inst-row-secret{flex-wrap:wrap}
      .push-inst-row-secret:not(.is-g2a) .push-inst-secret{flex:1 1 100%}
      .push-inst-row-secret.is-g2a{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
      .push-inst-row-secret.is-g2a .push-test-btn{grid-column:1;justify-self:start;align-self:center}
      .push-inst-row-secret.is-g2a .push-target-actions{
        display:flex;flex-wrap:nowrap;grid-column:2;justify-self:end;align-self:center;
      }
    }

    /* 注册页推送：数量/时间同一行（radio + 文案 + 窄数字框） */
    .push-mode-row{
      display:flex;
      flex-wrap:wrap;
      align-items:center;
      gap:4px 16px;
    }
    .push-mode-opt{
      display:inline-flex;
      align-items:center;
      gap:8px;
      margin:0;
      min-width:0;
    }
    .push-mode-opt > label{
      display:inline-flex;
      align-items:center;
      gap:6px;
      margin:0;
      font-size:12px;
      font-weight:500;
      color:var(--text-2);
      letter-spacing:0.01em;
      white-space:nowrap;
      cursor:pointer;
    }
    .push-mode-opt > label input[type="radio"]{
      flex:0 0 auto;
      margin:0;
      accent-color:var(--accent);
    }
    .push-mode-opt > .inp,
    #v-register .push-mode-opt > .inp,
    #v-register .push-mode-row .inp{
      width:4.75em;
      min-width:4.5em;
      max-width:4.75em;
      flex:0 0 4.75em;
      padding:4px 6px;
      min-height:32px;
      height:32px;
      font-size:13px;
      line-height:22px;
      text-align:center;
      font-variant-numeric:tabular-nums;
      -moz-appearance:textfield;
    }
    .push-mode-opt > .inp::-webkit-outer-spin-button,
    .push-mode-opt > .inp::-webkit-inner-spin-button,
    #v-register .push-mode-opt > .inp::-webkit-outer-spin-button,
    #v-register .push-mode-opt > .inp::-webkit-inner-spin-button,
    #v-register .push-mode-row .inp::-webkit-outer-spin-button,
    #v-register .push-mode-row .inp::-webkit-inner-spin-button{
      -webkit-appearance:none;
      margin:0;
    }
    /* 三列窄格（内容宽≈311px）：列间距收紧；数字框仍须容纳 999 */
    :is(.push-trio,.g2a-push-trio) .push-mode-row{gap:4px 8px}
    #v-register :is(.push-trio,.g2a-push-trio) .push-mode-opt > .inp{
      width:4.25em;min-width:4em;max-width:4.25em;flex:0 0 4.25em;padding:4px 4px;
    }
    @media(max-width:640px){
      .push-mode-row{gap:8px 16px}
      .push-mode-opt > .inp,
      #v-register .push-mode-opt > .inp,
      #v-register .push-mode-row .inp{
        width:5em;
        min-width:4.75em;
        max-width:5em;
        flex:0 0 5em;
        min-height:36px;
        height:36px;
        font-size:16px;
        line-height:24px;
      }
    }
