/* Окно «Настройки»: слева разделы, справа содержимое; на узком экране на весь экран, список и раздел по очереди. */
.set-back { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .66); display: flex; align-items: center; justify-content: center; padding: 16px; }
.set-win { display: flex; width: min(820px, 100%); height: min(720px, 100%); background: #18181c; border-radius: 28px; overflow: hidden; }
.set-nav { flex: 0 0 240px; width: 240px; display: flex; flex-direction: column; min-height: 0; background: var(--side); }
.set-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.set-head { display: flex; align-items: center; gap: 8px; padding: 18px 16px 8px 24px; }
.set-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-nav .set-head { padding-right: 20px; }
.set-back-btn, .set-close-nav { display: none; }
.set-body { flex: 1; overflow-y: auto; padding: 8px 24px 24px; }
.set-body .lead { text-align: left; margin-bottom: 18px; }
.set-form .field-label { margin: 16px 0 8px 2px; }
.set-form .field-label:first-of-type { margin-top: 0; }
.set-form .hint:first-child { margin-top: 0; margin-bottom: 14px; }

.set-list { list-style: none; margin: 0; padding: 4px 10px 12px; overflow-y: auto; flex: 1; }
.set-group { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 10px 6px; }
.set-item { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 14px; text-align: left; }
.set-item:hover { background: rgba(255, 255, 255, .04); }
.set-item[aria-current] { background: var(--raise); }
.set-item-ico { color: var(--muted); }
.set-item[aria-current] .set-item-ico { color: var(--text); }
.set-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.set-item-title { font-weight: 600; }
.set-item-status { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 640px) {
  .set-back { padding: 0; }
  .set-win { width: 100%; height: 100%; border-radius: 0; }
  .set-nav { flex: 1 1 100%; width: 100%; }
  .set-main { display: none; }
  .set-win.in-section .set-nav { display: none; }
  .set-win.in-section .set-main { display: flex; }
  .set-head { padding: max(14px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); }
  .set-back-btn, .set-close-nav { display: grid; }
  .set-close-main { display: none; }
  .set-list { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .set-body { padding: 8px max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .set-form .modal-actions .btn { flex: 1; }
}

/* Раздел «Расход» */
.usage-balance .muted.usage-big-title { margin: 0 0 2px; }
.usage-big { font-size: 32px; font-weight: 700; margin: 0 0 4px; }
.usage-balance .muted { margin: 0 0 14px; }
.usage-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.usage-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px; background: var(--raise); border-radius: 14px; overflow-wrap: anywhere; }
.usage-tile strong { font-size: 17px; }
.usage-small { font-size: 12px; color: var(--muted); }
.usage h3 { font-size: 15px; margin: 22px 0 8px; }
.usage-bots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.usage-bot { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--raise); border-radius: 14px; overflow-wrap: anywhere; }
.usage-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.usage-table th, .usage-table td { padding: 8px 4px; text-align: right; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.usage-table th:first-child, .usage-table td:first-child { text-align: left; width: 17%; }
.usage-table th { color: var(--muted); font-weight: 600; }
.usage .hint a { color: var(--accent); }
@media (max-width: 480px) {
  .usage-tiles { grid-template-columns: 1fr; }
  .usage-table { font-size: 12px; }
}
