.glyph-picker-window {
  width: min(1120px, calc(100vw - 24px));
  height: min(760px, calc(100vh - 24px));
  min-width: 740px;
  min-height: 500px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 26px 64px rgba(20, 38, 70, 0.28);
}

.glyph-picker-header {
  cursor: move;
  user-select: none;
  background:
    linear-gradient(180deg, rgba(248, 252, 255, 0.98) 0%, rgba(239, 247, 255, 0.94) 100%);
  border-bottom: 1px solid #c8d9ef;
}

#glyph-picker-title {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

#glyph-picker-type-badge {
  background: #e8f1ff;
  border-color: #bfd5f2;
  color: #375f95;
}

.glyph-picker-body {
  padding: 0;
  display: flex;
  min-height: 0;
}

.glyph-picker-layout {
  display: grid;
  grid-template-columns: 184px 1fr 280px;
  width: 100%;
  min-height: 0;
  background: #f8fbff;
}

.glyph-picker-sidebar {
  border-right: 1px solid var(--line);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background:
    linear-gradient(180deg, rgba(246, 251, 255, 0.95) 0%, rgba(240, 248, 255, 0.88) 100%);
}

.glyph-picker-nav-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #5b708f;
  margin-bottom: 4px;
}

.glyph-picker-nav-btn {
  border: 1px solid #c9d8eb;
  background: linear-gradient(180deg, #ffffff 0%, #f5faff 100%);
  color: #1b2f4c;
  border-radius: 10px;
  padding: 9px 10px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 120ms ease, transform 90ms ease, background 120ms ease;
}

.glyph-picker-nav-btn:hover {
  border-color: #9ebbe2;
  background: linear-gradient(180deg, #ffffff 0%, #edf5ff 100%);
}

.glyph-picker-nav-btn.active {
  border-color: #6f99d2;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: inset 0 0 0 1px rgba(145, 177, 219, 0.58);
}

.glyph-picker-nav-count {
  color: #4d6585;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(220, 234, 251, 0.95);
  border: 1px solid #bfd4f1;
  border-radius: 999px;
  padding: 0.1rem 0.46rem;
}

.glyph-picker-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.glyph-picker-search-row {
  border-bottom: 1px solid var(--line);
  padding: 12px 12px 11px;
  display: grid;
  gap: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
}

.glyph-picker-search-main {
  display: grid;
  grid-template-columns: minmax(260px, 640px) auto;
  gap: 8px;
  align-items: center;
}

.glyph-picker-search-sub {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.glyph-picker-search-input {
  width: 100%;
  border: 1px solid #c2d4eb;
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  background: #ffffff;
  color: #1c2e45;
}

.glyph-picker-search-input:focus-visible {
  outline: 2px solid #7ba7dd;
  outline-offset: 0;
  border-color: #7ba7dd;
}

.glyph-picker-search-clear {
  justify-self: start;
  border-radius: 8px;
  min-width: 74px;
}

.glyph-picker-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #5a6f8b;
  white-space: nowrap;
  padding: 0 2px;
}

.glyph-picker-toggle input {
  margin: 0;
}

.glyph-picker-help-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #b7cae3;
  background: linear-gradient(180deg, #f9fcff 0%, #edf5ff 100%);
  color: #4f6d95;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
}

.glyph-picker-help-icon:hover {
  border-color: #95b4db;
  background: linear-gradient(180deg, #ffffff 0%, #e4effd 100%);
}

.glyph-picker-grid-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 11px;
}

.glyph-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 9px;
}

.glyph-picker-item {
  border: 1px solid #c8d8eb;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 10px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: transform 100ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.glyph-picker-item:hover {
  border-color: #93b5df;
  background: linear-gradient(180deg, #ffffff 0%, #ebf3ff 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(48, 86, 132, 0.15);
}

.glyph-picker-item:focus-visible {
  outline: 2px solid #77a4db;
  outline-offset: 1px;
}

.glyph-picker-item.active {
  border-color: #5b89c7;
  background: linear-gradient(180deg, #e8f2ff 0%, #d9eaff 100%);
  box-shadow:
    inset 0 0 0 1px rgba(151, 184, 224, 0.74),
    0 4px 10px rgba(71, 113, 164, 0.18);
}

.glyph-picker-empty {
  grid-column: 1 / -1;
  border: 1px dashed #b8cae2;
  border-radius: 10px;
  background: #f7fbff;
  padding: 28px 20px;
  text-align: center;
  color: #607492;
}

.glyph-picker-preview {
  border-left: 1px solid var(--line);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  background:
    linear-gradient(180deg, rgba(251, 253, 255, 0.96) 0%, rgba(245, 250, 255, 0.94) 100%);
}

.glyph-picker-preview-glyph {
  min-height: 122px;
  border: 1px solid #bfd4ef;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.15rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.glyph-picker-preview-meta {
  font-size: 0.84rem;
  color: #30425f;
  display: grid;
  gap: 7px;
}

.glyph-picker-preview-field {
  display: grid;
  gap: 3px;
}

.glyph-picker-preview-field-label {
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6780a2;
  font-weight: 700;
}

.glyph-picker-preview-meta .muted {
  font-size: 0.79rem;
}

.glyph-picker-actions {
  margin-top: auto;
  display: grid;
  gap: 9px;
}

.glyph-picker-actions .primary {
  font-weight: 700;
}

.glyph-picker-status {
  min-height: 1.2rem;
  font-size: 0.8rem;
  color: #526b8a;
  padding-left: 2px;
}

.glyph-picker-grid-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.glyph-picker-grid-wrap::-webkit-scrollbar-thumb {
  background: #adc2dd;
  border-radius: 999px;
  border: 2px solid #eef4fc;
}

.glyph-picker-grid-wrap::-webkit-scrollbar-track {
  background: #eef4fc;
  border-radius: 999px;
}

@media (max-width: 980px) {
  .glyph-picker-window {
    min-width: 320px;
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }

  .glyph-picker-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .glyph-picker-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .glyph-picker-nav-title {
    width: 100%;
    margin-bottom: 0;
  }

  .glyph-picker-preview {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .glyph-picker-search-main {
    grid-template-columns: 1fr auto;
  }
}

body[data-ui-theme="dark"] .glyph-picker-sidebar,
body[data-ui-theme="dark"] .glyph-picker-preview {
  background: linear-gradient(180deg, rgba(22, 27, 36, 0.96) 0%, rgba(18, 23, 31, 0.94) 100%);
}

body[data-ui-theme="dark"] .glyph-picker-nav-title,
body[data-ui-theme="dark"] .glyph-picker-nav-count,
body[data-ui-theme="dark"] .glyph-picker-empty,
body[data-ui-theme="dark"] .glyph-picker-status {
  color: #9fabbc;
}

body[data-ui-theme="dark"] .glyph-picker-window {
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.62);
}

body[data-ui-theme="dark"] .glyph-picker-header {
  background: linear-gradient(180deg, rgba(17, 28, 44, 0.98) 0%, rgba(17, 27, 42, 0.94) 100%);
  border-bottom-color: #2a3f5f;
}

body[data-ui-theme="dark"] #glyph-picker-type-badge {
  background: #1f3656;
  border-color: #36557d;
  color: #d0e3ff;
}

body[data-ui-theme="dark"] .glyph-picker-layout {
  background: #121923;
}

body[data-ui-theme="dark"] .glyph-picker-nav-btn {
  border-color: #3d4f67;
  background: linear-gradient(180deg, #253141 0%, #1f2a38 100%);
  color: #d8e2f0;
}

body[data-ui-theme="dark"] .glyph-picker-nav-btn:hover {
  border-color: #5d7ca4;
  background: linear-gradient(180deg, #2a3a4f 0%, #253547 100%);
}

body[data-ui-theme="dark"] .glyph-picker-nav-btn.active {
  border-color: #5f85b8;
  background: linear-gradient(180deg, #314864 0%, #2a3f58 100%);
  box-shadow: inset 0 0 0 1px rgba(95, 133, 184, 0.44);
}

body[data-ui-theme="dark"] .glyph-picker-nav-count {
  background: rgba(65, 87, 116, 0.75);
  border-color: #4c6586;
}

body[data-ui-theme="dark"] .glyph-picker-search-row {
  background: linear-gradient(180deg, rgba(24, 33, 44, 0.98) 0%, rgba(19, 28, 38, 0.94) 100%);
}

body[data-ui-theme="dark"] .glyph-picker-search-input {
  border-color: #4a607e;
  background: #1d2735;
  color: #e7edf7;
}

body[data-ui-theme="dark"] .glyph-picker-search-input:focus-visible {
  outline-color: #77a3dc;
  border-color: #77a3dc;
}

body[data-ui-theme="dark"] .glyph-picker-toggle {
  color: #9fb0c8;
}

body[data-ui-theme="dark"] .glyph-picker-help-icon {
  border-color: #4d6382;
  background: linear-gradient(180deg, #273649 0%, #1f2b3b 100%);
  color: #bfd2ee;
}

body[data-ui-theme="dark"] .glyph-picker-help-icon:hover {
  border-color: #7196c8;
  background: linear-gradient(180deg, #30435d 0%, #27384d 100%);
}

body[data-ui-theme="dark"] .glyph-picker-item {
  border-color: #3f5168;
  background: linear-gradient(180deg, #263545 0%, #1f2b39 100%);
}

body[data-ui-theme="dark"] .glyph-picker-item:hover {
  border-color: #628abf;
  background: linear-gradient(180deg, #2e4258 0%, #26384c 100%);
  box-shadow: 0 8px 16px rgba(2, 8, 18, 0.46);
}

body[data-ui-theme="dark"] .glyph-picker-item.active {
  border-color: #5580bd;
  background: linear-gradient(180deg, #324b68 0%, #2a3e57 100%);
  box-shadow: inset 0 0 0 1px #3a5478;
}

body[data-ui-theme="dark"] .glyph-picker-empty {
  border-color: #405369;
  background: #1a2532;
}

body[data-ui-theme="dark"] .glyph-picker-preview-glyph {
  border-color: #3f526a;
  background: #1e2b3a;
}

body[data-ui-theme="dark"] .glyph-picker-preview-meta {
  color: #cfdae8;
}

body[data-ui-theme="dark"] .glyph-picker-preview-field-label {
  color: #8eaccf;
}

body[data-ui-theme="dark"] .glyph-picker-grid-wrap::-webkit-scrollbar-thumb {
  background: #617892;
  border-color: #202c3a;
}

body[data-ui-theme="dark"] .glyph-picker-grid-wrap::-webkit-scrollbar-track {
  background: #202c3a;
}
