.plugin-page-tabs {
  display: inline-flex;
  gap: 4px;
  margin: -7px 0 20px;
  padding: 4px;
  border: 1px solid #29302e;
  border-radius: 10px;
  background: #0b0e10;
}

.plugin-page-tabs button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #77818a;
  font: 700 11px/1 Inter, "Segoe UI", sans-serif;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.plugin-page-tabs button:hover { color: #d9dee1; }
.plugin-page-tabs button.active {
  background: linear-gradient(180deg, var(--accent-surface-strong), var(--accent-surface));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}
.plugin-page-tabs svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-plugin-panel][hidden] { display: none !important; }
#refresh-plugins[hidden], .config-drop-zone[hidden], .config-editor-workspace[hidden] { display: none !important; }

.config-editor-shell { overflow: hidden; border-color: #29302e; background: linear-gradient(145deg, #14181b, #0d1012); }
.config-drop-zone {
  min-height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin: 22px;
  padding: 38px 24px;
  border: 1px dashed #39423f;
  border-radius: 13px;
  background: radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 45%), #0b0e10;
  text-align: center;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.config-drop-zone.dragging { border-color: var(--accent); background-color: var(--accent-surface-deep); transform: scale(.997); }
.config-drop-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 16px; border: 1px solid var(--accent-border); border-radius: 14px; background: var(--accent-surface); color: var(--accent); }
.config-drop-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.config-drop-zone b { display: block; color: #edf1f2; font-size: 16px; }
.config-drop-zone small { display: block; max-width: 440px; margin-top: 8px; color: #68727b; font-size: 11px; line-height: 1.6; }
.config-primary-button { height: 40px; display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; padding: 0 15px; border: 1px solid var(--accent-border-strong); border-radius: 8px; background: linear-gradient(180deg, var(--accent-surface-strong), var(--accent-surface-deep)); color: var(--accent); font: 750 11px/1 Inter, "Segoe UI", sans-serif; cursor: pointer; }
.config-primary-button:hover { background: var(--accent-surface-strong); }
.config-primary-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.config-load-error { max-width: 520px; margin-top: 16px; padding: 9px 12px; border: 1px solid #714139; border-radius: 7px; background: #241614; color: #ff9187; font-size: 10.5px; line-height: 1.45; }

.config-editor-workspace { min-width: 0; }
.config-editor-toolbar { min-height: 78px; display: grid; grid-template-columns:minmax(190px, 1fr) minmax(220px, 360px) auto; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid #29302e; background: #101416; }
.config-file-identity { min-width: 0; display: flex; align-items: center; gap: 11px; }
.config-file-identity > span { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; border: 1px solid var(--accent-border); border-radius: 9px; background: var(--accent-surface); color: var(--accent); }
.config-file-identity svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.config-file-identity > div { min-width: 0; }
.config-file-identity b { display: block; overflow: hidden; color: #e8ecee; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.config-file-identity small { display: flex; align-items: center; gap: 6px; margin-top: 5px; color: #69737c; font-size: 9.5px; }
.config-file-identity [data-config-summary] { font-size: 12px; }
.config-modified-state { color: var(--accent); font-weight: 750; text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 28%, transparent); }
.config-file-identity small i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.config-search { height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid #30363b; border-radius: 8px; background: #090c0e; color: #69727c; }
.config-search:focus-within { border-color: var(--accent-border-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 5%, transparent); }
.config-search svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.config-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #e4e8eb; font: 500 11px/1 Inter, "Segoe UI", sans-serif; }
.config-search input::placeholder { color: #626a74; }
.config-editor-actions { display: flex; align-items: center; gap: 8px; }
.config-editor-actions button { height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid #30373b; border-radius: 8px; background: #12171a; color: #9aa3aa; font: 700 10.5px/1 Inter, "Segoe UI", sans-serif; cursor: pointer; white-space: nowrap; }
.config-editor-actions button:hover { border-color: #465057; color: #e2e6e8; }
.config-editor-actions .config-export-button { border-color: var(--accent-border-strong); background: linear-gradient(180deg, var(--accent-surface-strong), var(--accent-surface-deep)); color: var(--accent); }
.config-editor-actions svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.config-editor-notice { margin: 16px 20px 0; padding: 11px 13px; border: 1px solid #714139; border-radius: 8px; background: #241614; color: #ff9187; font-size: 11px; }

.config-field-tree { padding: 18px 20px 24px; }
.config-node[hidden] { display: none !important; }
.config-group { margin: 0 0 10px; border: 1px solid #293033; border-radius: 10px; background: #0d1113; }
.config-group .config-group { margin: 9px 10px; border-color: #272d30; background: #0a0d0f; }
.config-group summary { min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 0 13px; color: #dfe4e6; cursor: pointer; list-style: none; user-select: none; }
.config-group summary::-webkit-details-marker { display: none; }
.config-group summary::before { width: 15px; height: 15px; display: grid; place-items: center; flex: 0 0 15px; color: #6f7981; font-size: 13px; content: "›"; transition: transform .15s ease; }
.config-group[open] > summary::before { transform: rotate(90deg); }
.config-group summary:hover { color: var(--accent-soft); }
.config-group-name { min-width: 0; overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.config-group-key { min-width: 0; overflow: hidden; color: #59636b; font: 9.5px/1 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.config-group summary em { margin-left: auto; padding: 4px 7px; border-radius: 5px; background: #171c1f; color: #68737b; font: 700 8.5px/1 Inter, sans-serif; text-transform: uppercase; }
.config-group-children { padding: 0 10px 10px; }
.config-empty-value { padding: 15px; color: #5e6870; font-size: 10px; text-align: center; }
.config-array-add { height: 32px; display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 12px 20px; padding: 0 10px; border: 1px dashed #3a4449; border-radius: 7px; background: transparent; color: #7c878f; font: 700 9.5px/1 Inter, sans-serif; cursor: pointer; }
.config-array-add:hover { border-color: var(--accent-border-strong); color: var(--accent); }

.config-field { min-height: 58px; display: grid; grid-template-columns:minmax(180px, .9fr) minmax(220px, 1.1fr) auto; align-items: center; gap: 15px; padding: 9px 12px; border-bottom: 1px solid #23292c; }
.config-group-children > .config-field:last-child { border-bottom: 0; }
.config-field-label { min-width: 0; }
.config-field-label b { display: block; overflow: hidden; color: #cfd5d8; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.config-field-label small { display: block; overflow: hidden; margin-top: 5px; color: #535d65; font: 9px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.config-control { min-width: 0; }
.config-control input[type="text"], .config-control input[type="number"] { width: 100%; height: 36px; padding: 0 10px; border: 1px solid #30373b; border-radius: 7px; outline: 0; background: #090c0e; color: #dde2e4; font: 500 11px/1 Inter, "Segoe UI", sans-serif; }
.config-control input[type="text"] { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.config-control input:focus { border-color: var(--accent-border-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 5%, transparent); }
.config-control input.invalid { border-color: #a14e45; box-shadow: 0 0 0 3px rgba(255, 116, 104, .06); }
.config-number-control { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 7px; }
.config-number-scrubber { width: 34px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid #30373b; border-radius: 7px; background: #111619; color: #6f7a82; font: 700 14px/1 Inter, sans-serif; cursor: ew-resize; touch-action: none; user-select: none; transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease; }
.config-number-scrubber:hover, .config-number-scrubber:focus-visible { border-color: var(--accent-border-strong); color: var(--accent); outline: 0; }
.config-number-scrubber.dragging { border-color: var(--accent); background: var(--accent-surface-strong); color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 7%, transparent), 0 0 10px color-mix(in srgb, var(--accent) 14%, transparent); }
.config-color-control { display: grid; grid-template-columns: 38px 1fr; gap: 7px; }
.config-color-control input[type="color"] { width: 38px; height: 36px; padding: 3px; border: 1px solid #30373b; border-radius: 7px; background: #090c0e; cursor: pointer; }
.config-boolean { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.config-boolean input { position: absolute; opacity: 0; pointer-events: none; }
.config-boolean i { position: relative; width: 38px; height: 21px; flex: 0 0 38px; border: 1px solid #3b4348; border-radius: 999px; background: #171c1f; transition: border-color .16s ease, background .16s ease; }
.config-boolean i::after { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #747d84; content: ""; transition: transform .16s ease, background .16s ease, box-shadow .16s ease; }
.config-boolean input:checked + i { border-color: var(--accent-border-strong); background: var(--accent-surface-strong); }
.config-boolean input:checked + i::after { background: var(--accent); box-shadow: 0 0 7px color-mix(in srgb, var(--accent) 45%, transparent); transform: translateX(17px); }
.config-boolean span { color: #7b858d; font-size: 10px; font-weight: 700; }
.config-null { color: #68727a; font: italic 10px/1 ui-monospace, monospace; }
.config-remove-item { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #606a72; cursor: pointer; }
.config-remove-item:hover { border-color: #59332f; background: #241615; color: #ff8175; }
.config-remove-item svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.config-search-empty { padding: 60px 20px; color: #68727b; font-size: 11px; text-align: center; }

@media (max-width: 900px) {
  .config-editor-toolbar { grid-template-columns: 1fr auto; }
  .config-search { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 650px) {
  .plugin-page-tabs { width: 100%; }
  .plugin-page-tabs button { flex: 1; justify-content: center; }
  .config-drop-zone { margin: 14px; }
  .config-editor-toolbar { display: flex; align-items: stretch; flex-direction: column; }
  .config-editor-actions button { flex: 1; justify-content: center; }
  .config-field-tree { padding: 12px; }
  .config-field { grid-template-columns: 1fr auto; gap: 9px; }
  .config-control { grid-column: 1 / -1; grid-row: 2; }
  .config-remove-item { grid-column: 2; grid-row: 1; }
  .config-group-name { max-width: 170px; }
  .config-group-key { display: none; }
}
