/* Стили виджета «fonts» — подключаются только на страницах с ним */
.nf { margin: 1.6em 0 2.4em; max-width: 960px; }
.nf__bar {
  position: sticky; top: var(--header-h); z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
  margin: 0 -12px; padding: 14px 12px; background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.nf__field {
  display: flex; align-items: center; gap: 6px; padding: 0 6px 0 16px; height: 58px;
  background: var(--surface); border: 2px solid var(--green-line); border-radius: 14px;
}
.nf__field:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.nf__input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font: 500 22px/1 var(--font); color: var(--text-strong); }
.nf__input::placeholder { color: var(--muted); font-weight: 400; }
.nf__opts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; font-size: 14.5px; }
.nf__switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.nf__switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nf__switch-ui { position: relative; flex: none; width: 40px; height: 22px; border-radius: 999px; background: var(--border-2); transition: .2s; }
.nf__switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.nf__switch input:checked + .nf__switch-ui { background: var(--accent); }
.nf__switch input:checked + .nf__switch-ui::after { transform: translateX(18px); }
.nf__switch input:focus-visible + .nf__switch-ui { outline: 2px solid var(--green); outline-offset: 2px; }
.nf__frame { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.nf__frame select {
  height: 36px; padding: 0 30px 0 12px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface);
  color: var(--text-strong); font: inherit; cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.nf__groups { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.nf__groups::-webkit-scrollbar { display: none; }
.nf__row { display: flex; align-items: stretch; gap: 8px; }
.nf__row[hidden] { display: none; }
.nf__pick {
  flex: 1; min-width: 0; display: grid; gap: 2px; padding: 12px 16px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font: inherit;
  transition: border-color .15s, background-color .15s;
}
.nf__pick:hover, .nf__pick:focus-visible { border-color: var(--green-hover-line); outline: none; }
.nf__name { font-size: 13px; color: var(--muted); }
.nf__badge { margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.nf__out {
  font-size: 24px; line-height: 1.35; color: var(--text-strong); overflow-wrap: anywhere; min-height: 1.35em;
  font-family: 'Segoe UI Symbol', 'Cambria Math', 'STIX Two Math', 'Noto Sans Math', 'DejaVu Math TeX Gyre', var(--font);
}
.nf__copy { align-self: center; height: 40px; }
.nf__row.is-copied .nf__pick { border-color: var(--green); background: var(--green-soft); }
.nf__row.is-copied .nf__copy { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
@media (max-width: 640px) {
  .nf__bar { margin: 0 -8px; padding: 10px 8px; gap: 10px; }
  .nf__field { height: 50px; }
  .nf__input { font-size: 19px; }
  .nf__copy { display: none; }
  .nf__out { font-size: 21px; }
  .nf__opts { font-size: 13.5px; }
}
/* Русские буквы: сегментный переключатель */
.nf__cyr { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nf__cyr-label { color: var(--muted); }
.nf__seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); }
.nf__seg button { padding: 6px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.nf__seg button:hover { color: var(--text-strong); }
.nf__seg button.is-active { background: var(--green-soft); color: var(--green); font-weight: 600; box-shadow: inset 0 0 0 1px var(--green-line); }
.nf__dice { height: 36px; padding: 0 14px; font-size: 14px; }
.nf__badge--ru { color: var(--green); border-color: var(--green-line); background: var(--green-soft); }
.nf__row.is-lucky .nf__pick { border-color: var(--warn); box-shadow: 0 0 0 3px rgba(245, 180, 0, .18); }
/* Символы для ника */
.nf__sym { margin: 14px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); }
.nf__sym summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 14px 16px; cursor: pointer; font-weight: 600; color: var(--text-strong); list-style: none; }
.nf__sym summary::-webkit-details-marker { display: none; }
.nf__sym summary::after { content: '▾'; color: var(--muted); margin-left: auto; transition: transform .2s; }
.nf__sym[open] summary::after { transform: rotate(180deg); }
.nf__sym-hint { font-size: 13px; font-weight: 400; color: var(--muted); }
.nf__sym-group { display: grid; gap: 6px; padding: 0 16px 12px; }
.nf__sym-name { font-size: 12.5px; color: var(--muted); }
.nf__sym-list { display: flex; flex-wrap: wrap; gap: 6px; }
.nf__sym-btn {
  min-width: 42px; height: 42px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-strong); font-size: 20px; cursor: pointer; transition: border-color .15s, transform .1s, background-color .15s;
  font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', var(--font), var(--emoji-font);
}
.nf__sym-btn:hover, .nf__sym-btn:focus-visible { border-color: var(--green); outline: none; }
.nf__sym-btn:active { transform: scale(.94); }
.nf__sym-btn.is-added { background: var(--green-soft); border-color: var(--green); }
.nf__sym-more { margin: 0; padding: 0 16px 14px; font-size: 13.5px; color: var(--muted); }
@media (max-width: 640px) {
  .nf__seg button { padding: 6px 8px; font-size: 13px; }
  .nf__sym-btn { min-width: 40px; height: 40px; font-size: 19px; }
}
.nf__row.is-dim .nf__pick { opacity: .5; }
.nf__row.is-dim .nf__name::after { content: ' · не меняет русские буквы — включите «транслит»'; color: var(--warn); }
