/* 连接器面板（我们加的，不是原作者的）。class 一律 cn- 开头。样子照用量面板（us-）那一套，颜色都用 tokens.css 里的。 */
.cn-wrap { position: absolute; inset: 0; z-index: 26; }
.cn-scrim { position: absolute; inset: 0; border: 0; padding: 0; width: 100%; background: rgba(46, 56, 62, .3); opacity: 0; transition: opacity .25s; cursor: default; }
.cn { position: absolute; left: 0; right: 0; bottom: 0; height: 82%; padding: 8px 16px calc(14px + var(--safe-b)); border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 24px rgba(46, 56, 62, .18); transform: translateY(104%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; gap: 10px; }
.cn-wrap.on .cn-scrim { opacity: 1; }
.cn-wrap.on .cn { transform: none; }
.cn-handle { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line); flex: none; }

.cn-hd { display: flex; align-items: center; gap: 10px; flex: none; }
.cn-title { flex: 1; margin: 0; text-align: center; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-ib { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--mauve-deep); display: grid; place-items: center; cursor: pointer; }

.cn-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 6px; }
.cn-tip { margin: 6px 4px; font-size: 12px; line-height: 19px; color: var(--ink-2); }
.cn-sub { margin: 0 4px; font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.cn-list { padding: 2px 0; border-radius: var(--radius); flex: none; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--line); }
.cn .dot.ok { background: var(--sage, #828579); }
.cn .dot.warn { background: var(--gold, #B7A58F); }
.cn .dot.bad { background: var(--mauve-deep); }
.cn .dot.off { background: var(--line); }

.cn-row { display: flex; align-items: center; gap: 4px; padding: 0 12px 0 4px; }
.cn-row + .cn-row { border-top: 1px dashed var(--line); }
.cn-row .main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px 8px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.cn-row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cn-row .tx b { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-row .tx small { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-row .n { font-style: normal; font-family: var(--font-serif); font-size: 12.5px; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; display: grid; place-items: center; background: rgba(169, 154, 170, .2); color: var(--mauve-deep); }
.cn-row .main .ico { color: var(--line); flex: none; }
.cn-row.off .tx b, .cn-row.off .n { opacity: .5; }

/* 开关 */
.cn-sw { position: relative; flex: none; width: 44px; height: 26px; cursor: pointer; }
.cn-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cn-sw i { position: absolute; inset: 0; border-radius: 13px; background: var(--line); transition: background .2s; }
.cn-sw i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 3px rgba(81, 75, 74, .25); transition: transform .2s; }
.cn-sw input:checked + i { background: var(--mauve-btn); }
.cn-sw input:checked + i::after { transform: translateX(18px); }
.cn-sw input:disabled + i { opacity: .5; }
.cn-sw input:focus-visible + i { outline: 2px solid var(--mauve-pale); outline-offset: 2px; }

/* 一个工具一行：名字 + 三档 */
.cn-tool { display: flex; align-items: center; gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
.cn-tool + .cn-tool { border-top: 1px dashed var(--line); }
.cn-tool b { flex: 1; min-width: 96px; font-size: 13.5px; font-weight: 500; word-break: break-word; }
.cn-tool.all b { font-weight: 600; }
.cn-tool small { font-size: 11px; color: var(--ink-2); }
.cn-seg { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: var(--card); }
.cn-seg button { height: 30px; padding: 0 9px; border: 0; background: none; font: inherit; font-size: 11.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.cn-seg button + button { border-left: 1px solid var(--line); }
.cn-seg button[aria-pressed="true"] { background: var(--mauve-btn); color: var(--paper); }
.cn-seg button[data-perm="block"][aria-pressed="true"] { background: var(--teal); }

/* 技能面板（js/skills.js）用同一套样子，只多这几条：说明平时只露两行，点一下展开 */
.cn-row.sk { align-items: flex-start; }
.cn-row.sk .cn-sw { margin-top: 14px; }
.cn-row.sk .tx small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 16px; }
.cn-row.sk.wide .tx small { display: block; -webkit-line-clamp: unset; }
.cn-row.sk .tx b { white-space: normal; word-break: break-all; }

/* 铺在设置页里的样子（.inline）：不盖住页面、不滑动，没有遮罩和把手；列表那一层不要顶栏，点进一个连接器才出现「返回 + 名字」 */
.cn-wrap.inline { position: static; scroll-margin-top: 104px; }   /* 设置页顶栏是悬着的，跳到这里时给它让出位置 */
.cn-wrap.inline .cn-scrim, .cn-wrap.inline .cn-handle { display: none; }
.cn-wrap.inline .cn { position: static; height: auto; padding: 0; border-radius: 0; box-shadow: none; transform: none; transition: none; background: none; }
.cn-wrap.inline .cn::before, .cn-wrap.inline .cn::after { display: none; }
.cn-wrap.inline .cn-body { overflow: visible; }
.cn-wrap.inline:not(.detail) .cn-hd { display: none; }
.cn-wrap.inline.detail .cn-hd [data-act$="refresh"] { visibility: hidden; }

/* 面板里的整行按钮（技能面板的「重开窗口」） */
.cn-btn { flex: none; margin: 0 4px; height: 42px; border-radius: 21px; border: 1px solid var(--line); background: var(--card); color: var(--mauve-deep); font: inherit; font-size: 14px; cursor: pointer; }
.cn-btn:disabled { opacity: .55; cursor: default; }

/* 改窗口名字的小面板（js/rename.js）：比连接器面板矮 */
.cn.rn { height: auto; max-height: 92%; }
.cn-row.rn-remote { padding: 0 12px 0 4px; }
.cn-row.rn-remote .main { cursor: default; }
.cn-row.rn-remote .tx small { white-space: normal; }
.rn-field { display: flex; flex-direction: column; gap: 6px; margin: 4px; font-size: 12px; color: var(--ink-2); }
.rn-field input { height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font: inherit; font-size: 16px; color: var(--ink); }
.rn-check { display: flex; align-items: center; gap: 10px; margin: 0 4px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.rn-check input { width: 18px; height: 18px; accent-color: var(--mauve-btn); }
.cn-tip b { font-weight: 600; color: var(--ink); }

/* 斜杠命令列表（js/slash.js）：贴在输入框上面的一张卡，一行一条命令 */
.sl-pop { position: absolute; left: 10px; right: 10px; z-index: 24; max-height: min(52vh, 380px); overflow-y: auto; padding: 6px; border-radius: 16px; background: var(--paper); border: 1px solid var(--lace);
  box-shadow: 0 8px 24px rgba(46, 56, 62, .18); display: flex; flex-direction: column; }
.sl-hd { margin: 8px 10px 2px; font-size: 11px; color: var(--ink-2); letter-spacing: .04em; flex: none; }
.sl-row { flex: none; display: flex; align-items: baseline; gap: 8px; width: 100%; min-height: 40px; padding: 9px 10px; border: 0; border-radius: 10px; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.sl-row:hover, .sl-row:focus-visible { background: rgba(169, 154, 170, .14); outline: none; }
.sl-row b { flex: none; max-width: 46%; font-size: 13.5px; font-weight: 600; color: var(--mauve-deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-row i { flex: 1; min-width: 0; font-style: normal; font-size: 12px; line-height: 17px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sl-row u { flex: none; align-self: center; text-decoration: none; font-size: 10.5px; padding: 1px 7px; border-radius: 9px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.sl-row.off b, .sl-row.off i { opacity: .5; }
.sl-row.off { cursor: default; }
.sl-fold { flex: none; display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 4px; padding: 11px 10px; border: 0; border-top: 1px dashed var(--line); background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.sl-fold b { font-size: 13px; font-weight: 600; }
.sl-fold i { flex: 1; font-style: normal; font-size: 11.5px; color: var(--ink-2); }
.sl-fold .ico { color: var(--ink-2); transition: transform .2s; }
.sl-fold[aria-expanded="true"] .ico { transform: rotate(90deg); }
.sl-more { display: flex; flex-direction: column; flex: none; }
.sl-more[hidden] { display: none; }
.sl-ft { flex: none; margin: 6px 10px 4px; font-size: 11.5px; line-height: 18px; color: var(--ink-2); }
.sl-ft button { border: 0; background: none; padding: 0 0 0 6px; font: inherit; color: var(--mauve-deep); text-decoration: underline; cursor: pointer; }

/* 回话的小卡（/btw 的回答、/recap 的总结）：用连接器面板那一套，矮一点 */
.cn.sl-card { height: auto; max-height: 82%; }
.sl-ask { margin: 0 4px; font-size: 12.5px; line-height: 19px; color: var(--ink-2); }
.sl-ans { flex: none; padding: 14px 16px; border-radius: var(--radius); font-size: 14.5px; line-height: 23px; color: var(--ink); white-space: pre-wrap; word-break: break-word; user-select: text; -webkit-user-select: text; }
