.ck-package-body { padding: .75rem; overflow-wrap: anywhere; }
.ck-package-body p { margin: .5rem 0; }
.ck-package-body details { padding: .35rem 0 .35rem .5rem; }
.ck-package-body pre { max-height: 20rem; overflow: auto; white-space: pre-wrap; font-size: .85em; }
.ck-package-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.ck-package-actions button { padding: .5rem .75rem; border: 1px solid var(--ui-border,#405967); border-radius: 6px; background: var(--ui-chrome,#172630); color: var(--ui-accent,#00c9ec); }
.ck-package-dialog { max-width: min(42rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; }
.ck-package-dialog label { display: block; }
.ck-package-dialog input { max-width: 100%; box-sizing: border-box; }
/* Plugin display surfaces are absent until explicitly enabled. */
.ck-plugin-controls { display:grid; gap:.65rem; margin:.7rem 0; }
.ck-plugin-controls label { display:flex; align-items:center; justify-content:space-between; gap:.8rem; }
.ck-plugin-controls input[type=number],.ck-plugin-controls select { max-width:12rem; color:inherit; background:var(--ui-chrome,#182b36); border:1px solid currentColor; border-radius:.4rem; padding:.35rem; }
.ck-plugin-status { overflow-wrap:anywhere; }
.ck-plugin-dashboard { position:fixed; z-index:19; right:1rem; bottom:6rem; width:320px; max-width:calc(100vw - 1rem); max-height:55vh; overflow:auto; resize:none; box-sizing:border-box; color:var(--ui-text,#eee9d3); background:var(--ui-chrome,#182b36); border:1px solid var(--ui-border,#526d75); border-radius:.8rem; box-shadow:0 4px 20px #0008; font-size:14px; }
.ck-plugin-dashboard-header { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem; padding:.6rem; cursor:move; touch-action:none; }
.ck-plugin-dashboard-header strong { margin-right:auto; }
.ck-plugin-dashboard button,.ck-plugin-controls button { color:inherit; background:#ffffff0c; border:1px solid #ffffff40; border-radius:.4rem; padding:.5rem .65rem; min-height:36px; cursor:pointer; }
.ck-plugin-dashboard-body { padding:0 .7rem .7rem; }
.ck-plugin-dashboard article+article { border-top:1px solid #ffffff30; padding-top:.6rem; margin-top:.6rem; }
.ck-plugin-dashboard p { margin:.4rem 0; overflow-wrap:anywhere; }
.ck-plugin-dashboard.collapsed { resize:none; }
.ck-plugin-dashboard.collapsed .ck-plugin-dashboard-body { display:none; }
.ck-plugin-log { white-space:pre-wrap; overflow-wrap:anywhere; max-height:55vh; overflow:auto; user-select:text; }
@media(max-width:699px) { .ck-plugin-dashboard { right:.5rem; left:.5rem; bottom:calc(env(safe-area-inset-bottom) + 5rem); width:auto; resize:none; max-height:40vh; font-size:12px; } .ck-plugin-dashboard button { min-height:40px; } }

.ck-plugin-dashboard button:disabled,.ck-plugin-controls button:disabled,.ck-plugin-controls input:disabled,.ck-plugin-controls select:disabled { opacity:.55; cursor:default; }

.ck-plugin-layout-options { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem; padding:0 .7rem .7rem; }
.ck-plugin-layout-options[hidden] { display:none; }
.ck-plugin-layout-options select { max-width:100%; color:var(--ui-text,#eee9d3); background:var(--ui-raised,#243a44); border:1px solid var(--ui-border,#58717b); border-radius:.4rem; padding:.35rem; }
.ck-plugin-dashboard .ck-plugin-resize { position:absolute; right:2px; bottom:2px; width:26px; height:26px; min-height:26px; padding:0; cursor:nwse-resize; touch-action:none; }
.ck-plugin-dashboard-body { padding-bottom:1.7rem; }
.ck-plugin-dashboard.collapsed .ck-plugin-resize { display:none; }
@media(max-width:699px) { .ck-plugin-desktop-control { display:none!important; } .ck-plugin-dashboard-body { padding-bottom:.7rem; } }

/* Mobile cards reserve their own row above the main view. Vitals and command
   input remain outside that row; desktop panels keep their saved placement. */
@media(max-width:699px) {
 .ck-plugin-dashboard.ck-plugin-inline { position:relative;inset:auto;width:auto;max-width:none;flex:0 0 auto;align-self:stretch;order:initial;margin:4px 5px 0;box-shadow:none;border-radius:8px;z-index:auto; }
 .ck-plugin-inline .ck-plugin-dashboard-header { padding:3px 6px;gap:4px;cursor:default;touch-action:auto; }
 .ck-plugin-inline button { min-height:36px;padding:4px 8px;font-size:12px; }
 .ck-plugin-inline .ck-plugin-dashboard-body { padding:0 6px 5px; }
 .ck-plugin-inline article { display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:3px 6px; }
 .ck-plugin-inline article>strong { font-size:12px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
 .ck-plugin-inline article>p { max-width:48vw;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;margin:0; }
 .ck-plugin-inline .ck-package-actions { grid-column:1/-1;gap:5px;margin-top:0; }
 .ck-plugin-inline .ck-package-actions button { max-width:100%;overflow-wrap:anywhere;white-space:normal; }
 .ck-plugin-inline article+article { padding-top:4px;margin-top:4px; }
 body.ck-keyboard-slim .ck-plugin-inline,body.ck-native-keyboard .ck-plugin-inline { display:none!important; }
}

.ck-plugin-help p,.ck-plugin-help dd { white-space:pre-wrap;overflow-wrap:anywhere; }
.ck-plugin-help dt { margin-top:.8rem;overflow-wrap:anywhere; }
.ck-plugin-help code { white-space:pre-wrap;color:var(--ui-accent,#ffe2a2); }
.ck-plugin-help dd { margin:.25rem 0 .75rem; }
.ck-plugin-dashboard .ck-plugin-help-button { min-width:36px; }

.ck-plugin-dashboard-heading { flex:1;min-width:0; }
.ck-plugin-dashboard-summary { display:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.ck-plugin-dashboard.collapsed .ck-plugin-dashboard-title { display:none; }
.ck-plugin-dashboard.collapsed .ck-plugin-dashboard-summary { display:flex;gap:4px; }

.ck-plugin-dashboard-summary [data-header-status] { display:flex;min-width:0;flex:1;gap:4px; }
.ck-plugin-header-label { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1; }
.ck-plugin-dashboard-summary [data-plugin-deadline] { flex:none; }

@media(min-width:700px) {
 .ck-plugin-dashboard[data-position=right] .ck-plugin-resize { left:2px;top:2px;right:auto;bottom:auto;cursor:nwse-resize; }
 .ck-plugin-dashboard[data-position=left] .ck-plugin-resize { right:2px;top:2px;bottom:auto;cursor:nesw-resize; }
 .ck-plugin-dashboard[data-position=right]:not(.collapsed) .ck-plugin-dashboard-header { padding-left:32px; }
 .ck-plugin-dashboard[data-position=left]:not(.collapsed) .ck-plugin-dashboard-header { padding-right:32px; }
}

.ck-plugin-catalog article { border:1px solid var(--ui-border,#405967);border-radius:8px;padding:.7rem;margin:.6rem 0;overflow-wrap:anywhere; }
.ck-plugin-catalog article p {margin:.35rem 0;}
.ck-plugin-catalog .ck-package-actions input {flex:1;min-width:10rem;padding:.5rem;color:inherit;background:var(--ui-chrome,#172630);border:1px solid var(--ui-border,#405967);border-radius:6px;}
.ck-plugin-catalog button {min-height:40px;}

.ck-plugin-dashboard .ck-plugin-quick-row{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:4px;align-items:center}
.ck-plugin-quick-row>strong,.ck-plugin-quick-row>p{grid-column:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}
.ck-plugin-dashboard .ck-plugin-quick-actions{grid-column:2;grid-row:1 / span 2;display:flex;gap:0}
.ck-plugin-dashboard .ck-plugin-quick-actions button{width:48px;min-width:48px;height:48px;padding:0;font-size:19px}
.ck-plugin-quick-actions button:disabled{opacity:.35}

.ck-plugin-selection{display:flex;gap:.6rem;align-items:center;min-height:44px;cursor:pointer}
.ck-plugin-selection input[type=checkbox]{width:20px;height:20px;flex:none;accent-color:var(--ui-accent,#00d9ef)}
.ck-plugin-selection strong{min-width:0;overflow-wrap:anywhere}
.ck-plugin-batch{position:sticky;top:0;background:var(--ui-chrome,#172630);padding:.4rem 0;z-index:1;flex-wrap:wrap}
.ck-plugin-result{font-weight:600}

.ck-plugin-new-update{color:#ffdf45;font-weight:700;display:inline-block;margin-inline-start:.55em;font-size:.85em;}
.ck-package-group>summary{flex-wrap:wrap;}
/* Update button: a filled button on the plugin's name row, right aligned. The name keeps at
   most two lines and shortens with an ellipsis first; cards without an update keep their layout. */
.ck-package-group>summary.ck-plugin-has-update strong{min-width:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;line-height:1.25;overflow-wrap:break-word;}
/* The button always shows its whole label; the name beside it gives way instead. */
.ck-package-group>summary .ck-plugin-update{flex:none;min-height:36px;margin-inline-start:auto;padding:6px 14px;white-space:nowrap;font-size:.8rem;font-weight:700;line-height:1.2;color:#1d1700;background:#ffdf45;border:1px solid #ffdf45;border-radius:6px;cursor:pointer;}
.ck-package-group>summary .ck-plugin-update:focus-visible{outline:2px solid #ffdf45;outline-offset:2px;}
.ck-package-group>summary .ck-plugin-update:disabled{opacity:.55;cursor:wait;}
/* UI themes repaint every dialog button; keep the fill in the Plugin controls dialog too. */
body[data-ui-theme] :is(dialog,#trigger-modal) .ck-package-group>summary .ck-plugin-update{color:#1d1700!important;background:#ffdf45!important;border-color:#ffdf45!important;}
@media (pointer:coarse),(max-width:699px){.ck-package-group>summary .ck-plugin-update{min-height:44px;}}
/* Hover only where a pointer can hover: a tap on a phone must not leave the lighter colour behind. */
@media (hover:hover){.ck-package-group>summary .ck-plugin-update:hover:not(:disabled){color:#1d1700;background:#ffe878;}
body[data-ui-theme] :is(dialog,#trigger-modal) .ck-package-group>summary .ck-plugin-update:hover:not(:disabled){background:#ffe878!important;}}
.ck-package-group>summary .ck-plugin-update-note{flex-basis:100%;white-space:normal;overflow-wrap:anywhere;color:var(--ui-text-dim,#9fb3bf);}
/* The full plugin name, first in the opened card while the summary may shorten it. */
.ck-package-body .ck-plugin-full-name{font-weight:700;overflow-wrap:anywhere;}
