:root {
  color-scheme: dark;
  --bg: #030509;
  --panel: #080c13;
  --panel-soft: #101722;
  --line: #283747;
  --gold: #2f5f91;
  --gold-deep: #1f4268;
  --text: #f5f8ff;
  --muted: #8d9bb1;
  --purple: #4478a8;
  --top-height: 110px;
  --footer-height: 52px;
  --aside-width: 518px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }

body {
  min-width: 1080px;
  min-height: 100%;
  margin: 0;
  padding-bottom: var(--footer-height);
  overflow-x: hidden;
  color: var(--text);
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  background:
    radial-gradient(circle at 64% 24%, rgba(47, 95, 145, .07), transparent 31%),
    radial-gradient(circle at 78% 4%, rgba(68, 120, 168, .04), transparent 24%),
    var(--bg);
}

body::before {
  content: "乾　坤　震　巽　坎　离　艮　兑";
  position: fixed;
  z-index: 0;
  left: 47%;
  top: 12%;
  width: 54vw;
  height: 54vw;
  border: 1px solid rgba(45, 140, 255, .08);
  border-radius: 50%;
  color: rgba(45, 140, 255, .1);
  font-size: clamp(18px, 1.8vw, 34px);
  letter-spacing: 4.5vw;
  line-height: 13.5vw;
  text-align: center;
  transform: rotate(-12deg);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  opacity: .18;
  background-image:
    radial-gradient(circle at 4% 3%, #2d8cff 0 3px, transparent 5px),
    radial-gradient(circle at 28% 8%, #2d8cff 0 2px, transparent 5px),
    radial-gradient(circle at 63% 4%, #2d8cff 0 2px, transparent 5px),
    radial-gradient(circle at 84% 9%, #2d8cff 0 3px, transparent 6px),
    radial-gradient(circle at 96% 2%, #2d8cff 0 2px, transparent 5px);
  filter: blur(2px);
  pointer-events: none;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: relative;
  z-index: 3;
  height: var(--top-height);
  display: grid;
  grid-template-columns: 400px minmax(650px, 1fr) 420px;
  align-items: center;
  gap: 0;
  padding: 13px 28px;
  border-bottom: 1px solid rgba(68, 120, 168, .25);
  background:
    radial-gradient(circle at 8% 12%, rgba(47, 95, 145, .1), transparent 18%),
    linear-gradient(180deg, rgba(8, 15, 28, .98), rgba(3, 6, 12, .99));
}

.brand-block h1 { margin: 0 0 5px; font-size: 26px; letter-spacing: -.5px; }
.brand-block p { margin: 0; color: #8fa5bb; font-size: 12px; }
.top-center { align-self: stretch; min-width: 0; padding: 4px 0; }
.notice {
  height: 32px;
  margin-bottom: 8px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(68, 120, 168, .3);
  border-radius: 7px;
  color: #c9d7e5;
  font-size: 13px;
  font-weight: 700;
  background: rgba(47, 95, 145, .05);
}

.layer-tabs { display: flex; flex-wrap: nowrap; gap: 6px; overflow: hidden; }
.tab-button, .gold-button, .custom-button {
  border: 1px solid #4478a8;
  border-radius: 9px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #376f9f, #244d78);
  box-shadow: 0 4px 12px rgba(47, 95, 145, .14);
}
.tab-button { flex: 0 0 auto; padding: 6px 10px; font-size: 13px; }
.tab-button.active { color: #fff; background: #315f8c; box-shadow: 0 0 10px rgba(68, 120, 168, .2); }
.top-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-content: end;
  gap: 8px;
  padding-left: 20px;
}
.ghost-button, .footer-button {
  padding: 9px 13px;
  border: 1px solid #283750;
  border-radius: 9px;
  color: #eee;
  background: linear-gradient(180deg, #121925, #080c13);
}
.ghost-button:hover, .footer-button:hover { border-color: #2d8cff; color: #8bc8ff; }
.top-actions .ghost-button { min-height: 34px; padding: 7px 9px; font-size: 13px; }
.top-actions b { margin-left: 3px; color: #fff; }
.treasury-count b { padding: 2px 6px; border-radius: 10px; background: #176bff; }
.config-menu-wrap { position: relative; min-width: 0; }
.config-menu-wrap > .ghost-button { width: 100%; }
.config-menu {
  position: absolute;
  z-index: 36;
  top: calc(100% + 6px);
  left: 0;
  width: 160px;
  padding: 6px;
  border: 1px solid rgba(45, 140, 255, .48);
  border-radius: 10px;
  background: #0c111a;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .7);
}
.config-menu button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 7px; text-align: left; color: #eee; background: transparent; }
.config-menu button:hover { color: #8bc8ff; background: rgba(23, 107, 255, .14); }

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--aside-width) minmax(0, 1fr);
  align-items: start;
}

.output-panel {
  position: sticky;
  z-index: 4;
  top: 0;
  height: calc(100vh - var(--footer-height));
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid #24344f;
  background: rgba(4, 7, 12, .99);
}
.output-section { display: flex; flex-direction: column; min-height: 0; }
.prompt-section { height: 60%; }
.json-section { height: 40%; border-top: 1px solid #24344f; }
.output-heading {
  flex: 0 0 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px 11px 15px;
  background: linear-gradient(90deg, rgba(47, 95, 145, .05), transparent);
}
.output-heading small { letter-spacing: 3px; font-size: 12px; font-weight: 900; }
.output-heading h2 { margin: 5px 0 0; font-size: 18px; }
.output-heading span { color: var(--gold); }
.output-heading em { margin-left: 5px; color: #87bfff; font-size: 11px; font-style: normal; text-decoration: underline; }
.gold-button { padding: 10px 17px; white-space: nowrap; }
.copy-button { width: 126px; min-width: 126px; padding: 9px 8px; font-size: 13px; }
.output-content {
  flex: 1;
  min-height: 0;
  margin: 0 30px 0 14px;
  padding: 12px 15px;
  overflow: auto;
  white-space: pre-wrap;
  color: #f5f8ff;
  border: 1px solid #2a3b57;
  border-radius: 8px 8px 0 0;
  background: #080c13;
  scrollbar-color: #315f8c #080c13;
  font: 13px/1.62 "Microsoft YaHei UI", sans-serif;
}
.editable-output { cursor: text; caret-color: #fff; }
.editable-output:focus {
    outline: 1px solid #4ca5ff;
    outline-offset: -1px;
    box-shadow: inset 0 0 0 1px rgba(76, 165, 255, .18);
  }
  .editable-output.is-manually-edited {
    border-color: #4ca5ff;
    box-shadow: inset 3px 0 0 #4ca5ff;
  }
.json-section .output-content { color: #54a6ff; font-family: Consolas, "Microsoft YaHei UI", monospace; }
.prompt-token.fixed { color: #f5f8ff; }
.prompt-token.dynamic {
  color: #5797d3;
  font-weight: 700;
  text-shadow: none;
}
.json-key { color: #fff; font-weight: 700; }
.json-string { color: #54a6ff; }
.json-literal { color: #7dd8ff; }

.workspace { min-width: 0; overflow: visible; }
.layers { min-height: 100vh; }
.layer-card {
  min-height: 520px;
  padding: 72px 32px 27px;
  border-bottom: 1px solid #1c293d;
  transition: opacity .2s;
}
.layer-kicker { color: var(--gold); font-size: 12px; font-weight: 900; letter-spacing: 2px; }
.layer-title-row { display: flex; align-items: center; gap: 18px; margin-top: 11px; }
.layer-title { margin: 0; font-size: 38px; line-height: 1.15; }
.toggle-layer { padding: 5px 17px; border: 0; border-radius: 5px; font-weight: 900; color: #111; background: #fff; }
.layer-description { margin: 12px 0 38px; color: var(--muted); font-size: 14px; }
.group-list { display: grid; gap: 25px; }
.option-group { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 20px; align-items: start; }
.group-label-wrap { display: grid; gap: 9px; }
.group-label { color: #d9d9d4; font-size: 15px; font-weight: 700; }
.group-label::after { content: ""; display: block; width: 14px; margin-top: 5px; border-bottom: 3px solid rgba(45, 140, 255, .55); }
.custom-button { width: 112px; padding: 7px 14px; }
.group-control { min-width: 0; }
.options { display: flex; flex-wrap: wrap; gap: 7px; }
.option-button {
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid #2a3951;
  border-radius: 10px;
  color: #cfd0cb;
  background: rgba(13, 19, 29, .9);
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.option-button:hover { border-color: #4478a8; color: #fff; transform: translateY(-1px); }
.option-button.selected { border-color: var(--gold); color: #fff; background: rgba(47, 95, 145, .14); box-shadow: 0 0 8px rgba(68, 120, 168, .12); }
.primary-input, .custom-input {
  width: 100%;
  border: 1px solid #30415d;
  border-radius: 9px;
  outline: none;
  color: #f4f4ef;
  background: #101722;
}
.primary-input { min-height: 43px; padding: 11px 16px; resize: vertical; }
.primary-input:focus, .custom-input:focus { border-color: #4478a8; box-shadow: 0 0 0 3px rgba(68, 120, 168, .09); }
.color-picker-row { display: flex; flex-wrap: wrap; gap: 16px; }
.color-input-group { display: flex; flex-direction: column; gap: 6px; }
.color-label { color: var(--muted); font-size: 11px; }
.color-input-wrap { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-soft); }
.color-input-wrap input[type="color"] { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 3px; background: transparent; cursor: pointer; }
.color-text-input { width: 72px; border: 0; outline: 0; color: var(--text); background: transparent; font: 13px/1.4 Consolas, monospace; }
.color-reset-button { padding: 2px 8px; border: 0; border-radius: 4px; color: var(--muted); background: var(--line); font-size: 11px; }
.color-reset-button:hover { color: var(--text); }
.group-hint { min-height: 0; margin: 6px 0 0; color: #85867f; font-size: 12px; }
.group-actions { width: 100%; display: flex; gap: 8px; margin-top: 10px; }
.group-action { flex: 1; min-height: 34px; border: 0; border-radius: 7px; color: #fff; font-size: 13px; font-weight: 800; background: linear-gradient(135deg, #376f9f, #244d78); box-shadow: 0 3px 10px rgba(47, 95, 145, .12); }

.footerbar {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--footer-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 25px;
  border-top: 1px solid #263651;
  background: rgba(8, 12, 19, .99);
}
.footer-button { min-width: 92px; padding: 7px 17px; }
.pager-dots { display: flex; gap: 7px; }
.pager-dot { width: 8px; height: 8px; border-radius: 50%; background: #2e2f2b; }
.pager-dot.active { background: var(--gold); box-shadow: 0 0 12px rgba(45, 140, 255, .55); }
.footer-note { color: #bcbdb7; font-size: 13px; }
.page-indicator { margin-left: auto; min-width: 90px; padding: 6px 17px; border: 1px solid #2d2e29; border-radius: 5px; color: #ddd; text-align: center; }

.scroll-rail {
  position: fixed;
  z-index: 15;
  right: 17px;
  bottom: 72px;
  display: grid;
  gap: 8px;
}
.scroll-rail button {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  background: linear-gradient(145deg, #4478a8, #1f4268);
  box-shadow: 0 7px 18px rgba(47, 95, 145, .22);
}

.toast {
  position: fixed;
  z-index: 40;
  right: 28px;
  bottom: 72px;
  padding: 12px 20px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  color: #fff;
  font-weight: 800;
  background: var(--gold);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: #ff655f; color: #fff; background: #a52d2a; }

.activation-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 30%, rgba(23, 107, 255, .18), transparent 32%), rgba(3, 5, 9, .99);
}
.activation-card {
  width: min(520px, 100%);
  padding: 38px;
  border: 1px solid rgba(45, 140, 255, .5);
  border-radius: 20px;
  text-align: center;
  background: linear-gradient(145deg, #111a28, #070b12);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .75), 0 0 50px rgba(23, 107, 255, .16);
}
.activation-mark { display: grid; place-items: center; width: 70px; height: 70px; margin: 0 auto 15px; overflow: hidden; border-radius: 20px; color: #fff; font-weight: 1000; font-size: 22px; background: #000; box-shadow: 0 0 30px rgba(45, 140, 255, .42); }
.activation-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.activation-card h1 { margin: 7px 0 10px; font-size: 32px; }
.activation-card p { min-height: 24px; color: #8fc8ff; }
.activation-card form { display: grid; gap: 12px; margin-top: 20px; text-align: left; }
.activation-card textarea { width: 100%; padding: 12px; border: 1px solid #2b4770; border-radius: 10px; color: #fff; background: #080d16; resize: vertical; }
.activation-card .gold-button, .activation-card .ghost-button { width: 100%; margin-top: 8px; }
.activation-note { display: block; margin-top: 22px; color: #777870; }

.side-drawer {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  bottom: var(--footer-height);
  width: min(440px, 92vw);
  padding: 22px;
  overflow: auto;
  border-left: 1px solid rgba(45, 140, 255, .5);
  background: rgba(7, 11, 18, .99);
  box-shadow: -24px 0 60px rgba(0, 0, 0, .55);
  transform: translateX(105%);
  transition: transform .25s ease;
}
.side-drawer.open { transform: translateX(0); }
.drawer-heading, .dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.drawer-heading h2, .dialog-heading h2 { margin: 4px 0; }
.drawer-heading small, .dialog-heading small { color: var(--gold); letter-spacing: 2px; }
.side-drawer > p, .admin-panel > p { color: var(--muted); }
.wide-button { width: 100%; margin: 12px 0; }
.icon-button { border: 0; color: #eee; font-size: 28px; background: transparent; }
.favorite-list, .license-list { display: grid; gap: 10px; margin-top: 14px; color: var(--muted); }
.favorite-card, .license-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid #2b3b55; border-radius: 10px; color: #eee; background: #101722; }
.license-row > div:first-child { display: grid; gap: 4px; min-width: 0; }
.favorite-card small, .license-row small { color: #8d8e87; }
.license-key { color: #8bc8ff; font: 13px/1.5 Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.license-key.unavailable { color: #a17d7d; font-family: "Microsoft YaHei UI", sans-serif; }
.license-row > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.favorite-card button, .license-row button, .admin-tabs button { padding: 7px 10px; border: 1px solid #334560; border-radius: 7px; color: #ddd; background: #141c28; }
.favorite-card button:hover, .license-row button:hover, .admin-tabs button.active { color: #8bc8ff; border-color: #2d8cff; }

.collection-drawer {
  bottom: 0;
  width: min(456px, 96vw);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #f4f4ef;
  background: #090d14;
  box-shadow: -20px 0 60px rgba(0, 0, 0, .76), inset 5px 0 18px rgba(23, 107, 255, .12);
}
.collection-toolbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 74px repeat(4, 1fr) 28px;
  align-items: stretch;
  gap: 6px;
  min-height: 120px;
  padding: 25px 15px 20px 18px;
  border-bottom: 1px solid #262721;
}
.collection-toolbar h2 { margin: 6px 0 0; color: var(--gold); font-size: 22px; line-height: 1.35; }
.collection-tool {
  min-width: 0;
  padding: 9px 5px;
  border: 1px solid #35362f;
  border-radius: 12px;
  color: #f1f1ed;
  line-height: 1.55;
  background: #1b1c19;
}
.collection-tool.active { color: #fff; border-color: #2d8cff; font-weight: 800; background: linear-gradient(145deg, #238bff, #103fd8); }
.collection-tool:hover { border-color: #2d8cff; color: #8bc8ff; }
.collection-tool.active:hover { color: #fff; }
.collection-close { align-self: start; width: 28px; height: 42px; padding: 0; border: 0; color: #aaa; font-size: 30px; background: transparent; }
.collection-search-wrap { flex: 0 0 auto; padding: 13px 16px 10px; }
.collection-search-wrap .primary-input { height: 44px; border-color: #2a3b56; border-radius: 11px; background: #101722; }
.favorite-categories { flex: 0 0 auto; display: flex; gap: 8px; padding: 2px 16px 10px; overflow-x: auto; scrollbar-width: none; }
.favorite-categories::-webkit-scrollbar { display: none; }
.favorite-category { flex: 0 0 auto; padding: 7px 12px; border: 1px solid #30415d; border-radius: 18px; color: #bfc8d8; background: #101722; }
.favorite-category.active { border-color: #2d8cff; color: #fff; font-weight: 800; background: var(--gold); }
.collection-divider { flex: 0 0 5px; margin: 0 9px 8px; border-radius: 4px; background: linear-gradient(90deg, #176bff 0 96%, transparent 96%); }
.collection-drawer .favorite-list { flex: 1 1 auto; min-height: 0; margin: 0; padding: 7px 17px 24px; overflow-y: auto; align-content: start; color: #8f9089; }
.collection-drawer .favorite-card {
  display: block;
  min-height: 84px;
  padding: 15px 15px 13px;
  border: 1px solid #293a55;
  border-radius: 11px;
  color: #f4f4f0;
  background: #101722;
}
.collection-drawer .favorite-card.active { border-color: var(--gold); box-shadow: 0 0 16px rgba(45, 140, 255, .18); }
.favorite-summary { display: grid; gap: 10px; }
.favorite-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.favorite-card-heading strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.favorite-card-heading small { flex: 0 0 auto; color: #989993; font-size: 11px; }
.favorite-tag { justify-self: start; max-width: 100%; padding: 3px 10px; overflow: hidden; border-radius: 12px; color: #78baff; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; background: rgba(23, 107, 255, .14); }
.favorite-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.collection-drawer .favorite-action { padding: 6px 10px; border-radius: 5px; font-size: 12px; background: #20211e; }
.collection-drawer .favorite-action.apply { border-color: #24bfff; color: #87ddff; background: rgba(36, 191, 255, .12); }
.collection-drawer .favorite-action.edit { border-color: #4f86ff; color: #9fc0ff; background: rgba(79, 134, 255, .14); }
.collection-drawer .favorite-action.copy { border-color: #5b5c55; color: #ddd; }
.collection-drawer .favorite-action.delete { border-color: #49627f; color: #a9bad0; background: rgba(73, 98, 127, .14); }
.treasury-toolbar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 102px; padding: 20px 18px; border-bottom: 1px solid #292a24; }
.treasury-toolbar h2 { margin: 5px 0 0; color: var(--gold); font-size: 25px; }
.treasury-toolbar small { color: #6eaeff; letter-spacing: 1.8px; }
.treasury-list { flex: 1 1 auto; min-height: 0; display: grid; align-content: start; gap: 10px; margin: 0; padding: 7px 17px 24px; overflow-y: auto; color: #8f9089; }
.treasury-card { display: grid; gap: 10px; padding: 14px; border: 1px solid #293a55; border-radius: 11px; color: #f4f7ff; background: #101722; }
.treasury-card.active { border-color: var(--gold); box-shadow: 0 0 16px rgba(45, 140, 255, .2); }
.treasury-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.treasury-card-heading strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.treasury-card-heading span { flex: 0 0 auto; padding: 3px 8px; border-radius: 10px; color: #78baff; font-size: 11px; background: rgba(23, 107, 255, .14); }
.treasury-card p { display: -webkit-box; margin: 0; overflow: hidden; color: #a9aaa4; font-size: 12px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.treasury-actions { display: flex; gap: 6px; }
.treasury-actions .favorite-action { padding: 6px 10px; border-radius: 5px; font-size: 12px; background: #20211e; }
.treasury-actions .favorite-action.apply { border-color: #24bfff; color: #87ddff; background: rgba(36, 191, 255, .12); }
.treasury-actions .favorite-action.copy { border-color: #176bff; color: #8bc8ff; background: rgba(23, 107, 255, .12); }
.favorite-dialog { width: min(400px, calc(100vw - 40px)); }
.favorite-dialog select { appearance: auto; }
.category-editor-list { display: grid; gap: 8px; margin-top: 18px; }
.category-editor-row { display: grid; grid-template-columns: 1fr auto auto; gap: 7px; }
.category-editor-row .ghost-button, .category-editor-row .danger-button { padding: 8px 12px; }
.danger-button { border: 1px solid #49627f; border-radius: 8px; color: #a9bad0; background: rgba(73, 98, 127, .14); }
.danger-button:disabled { opacity: .4; cursor: not-allowed; }
.category-add-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 14px; }

.modal-backdrop { position: fixed; z-index: 40; inset: 0; background: rgba(0, 0, 0, .72); backdrop-filter: blur(4px); }
.dialog-card {
  position: fixed;
  z-index: 50;
  top: 50%;
  left: 50%;
  width: min(560px, calc(100vw - 40px));
  max-height: calc(100vh - 50px);
  padding: 24px;
  overflow: auto;
  border: 1px solid rgba(45, 140, 255, .5);
  border-radius: 16px;
  background: #0c121c;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .72);
  transform: translate(-50%, -50%);
}
.dialog-card > label, #admin-login-view > label { display: grid; gap: 8px; margin-top: 17px; color: #d8d8d3; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.custom-dialog { width: min(620px, calc(100vw - 40px)); }
.custom-existing-section { margin-top: 18px; }
.custom-existing-section p { margin: 10px 0 0; color: #71849f; font-size: 12px; }
.custom-existing-options { display: flex; flex-wrap: wrap; gap: 9px; }
.custom-manager-chip {
  position: relative;
  padding: 9px 28px 9px 13px;
  border: 1px solid #38516f;
  border-radius: 18px;
  color: #c8d6e8;
  background: #111c2b;
}
.custom-manager-chip::after { position: absolute; right: 10px; content: '×'; color: #6f829c; }
.custom-manager-chip:hover { border-color: #2d8cff; color: #fff; }
.custom-manager-chip.selected { border-color: #ff4964; color: #fff; background: rgba(255, 73, 100, .12); }
.custom-manager-chip.selected::after { color: #ff6a80; }
.custom-modal-divider { height: 1px; margin-top: 17px; background: #25364d; }
.custom-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
.custom-dialog-actions .danger-button,
.custom-dialog-actions .gold-button { min-height: 44px; }
.custom-dialog-actions .danger-button { border-color: #b8344a; color: #ff6279; background: rgba(184, 52, 74, .11); }
.custom-dialog-actions .gold-button { color: #fff; background: linear-gradient(135deg, #286dca, #427faf); }
.admin-dialog { width: min(1000px, calc(100vw - 50px)); }
#admin-modal { z-index: 130; }
body:has(#activation-gate:not([hidden])) .modal-backdrop { z-index: 120; }
.admin-tabs { display: flex; gap: 8px; margin: 18px 0; border-bottom: 1px solid #33342f; padding-bottom: 12px; }
.admin-create-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.code-editor { width: 100%; min-height: 52vh; padding: 16px; border: 1px solid #30415d; border-radius: 10px; outline: none; resize: vertical; color: #8bc8ff; background: #080c13; font: 13px/1.55 Consolas, monospace; }
#created-license { font: 12px/1.5 Consolas, monospace; }
#admin-login-view { max-width: 520px; margin: 30px auto; }

@media (max-width: 1450px) {
  :root { --aside-width: 470px; }
  .topbar { grid-template-columns: 340px minmax(570px, 1fr) 340px; padding-inline: 18px; }
  .brand-block h1 { font-size: 22px; }
  .tab-button { padding-inline: 8px; }
  .top-actions { padding-left: 12px; }
}

@media (max-width: 1180px) {
  body { min-width: 900px; }
  :root { --aside-width: 400px; }
  .topbar { grid-template-columns: 265px minmax(500px, 1fr) 300px; }
  .brand-block h1 { font-size: 18px; }
  .brand-block p { display: none; }
  .top-actions .ghost-button { font-size: 12px; }
  .option-group { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }
  .layer-card { padding-inline: 26px; }
}
