/* ⚙️ «Настройки сервера» in sections (0.58 admin, admin-kit.js): sidebar + content on a desktop, a full-screen sheet with
   a chip row on a phone, one row look for every switch, mini tiles for games / shop / seasons, a sticky save bar. */
.admin-modal .admin-card.ak-card { width: min(960px, calc(100vw - 40px)); max-width: none; height: min(760px, calc(100vh - 40px)); max-height: none; padding: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
.ak-card [hidden], .ak-card .ak-gone { display: none !important; }
.ak-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.ak-head .admin-head { margin: 0; min-width: 0; }
.ak-head .admin-title { min-width: 0; }
.ak-head .admin-title { margin: 0; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.ak-head .admin-title .ico svg { width: 18px; height: 18px; color: var(--accent); }
.ak-sub { color: var(--muted); font-size: 12.5px; margin-top: -4px; }
.ak-search { min-width: 0; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; cursor: text; }
.ak-search:focus-within { border-color: var(--accent); }
.ak-search-ico svg { width: 16px; height: 16px; color: var(--muted); display: block; }
.ak-search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 14px; }
.ak-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 0; }
.ak-nav { border-right: 1px solid var(--line); padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.ak-nav-b { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; }
.ak-nav-b:hover { color: var(--text); background: rgba(255,255,255,.04); }
.ak-nav-b.on { background: rgba(229,160,13,.12); color: var(--text); box-shadow: inset 0 0 0 1px rgba(229,160,13,.5); }
.ak-nav-b:focus-visible { outline: 2px solid #ffd479; outline-offset: 1px; }
.ak-nav-b small { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); }
.ak-nav-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-ico { display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--accent); }
.ak-ico svg { width: 18px; height: 18px; display: block; }
.ak-nav-b .ak-ico svg { width: 16px; height: 16px; }
.ak-pic { width: 24px; height: 24px; object-fit: contain; display: block; }
.ak-nav-b .ak-pic { width: 22px; height: 22px; margin: -2px 0; }
.ak-sec-h .ak-pic { width: 28px; height: 28px; margin: -4px 0; }
.ak-line > .ak-ico:has(.ak-pic) { margin-top: -2px; }
.ak-main { min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 20px 30px; overscroll-behavior: contain; }
.ak-main:focus { outline: none; }
.ak-sec { margin-top: 18px; scroll-margin-top: 8px; }
.ak-sec-h { display: flex; align-items: center; gap: 8px; margin: 0 0 3px; font-size: 15px; font-weight: 750; }
.ak-sec-h:focus { outline: none; }
.ak-sec-sub { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; }
.ak-group { background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ak-danger .ak-group { border-color: rgba(255,107,107,.38); }
.ak-danger .ak-sec-h .ak-ico { color: #ff8b8b; }
.ak-common { padding: 8px 14px 10px; color: var(--muted); font-size: 12.5px; line-height: 1.4; background: rgba(229,160,13,.05); border-bottom: 1px solid var(--line); }
.ak-secoff { padding: 8px 14px; font-size: 12.5px; color: #ffcf6b; background: rgba(229,160,13,.08); border-bottom: 1px solid var(--line); }
.ak-rows:empty, .ak-grid:empty { display: none; }
.ak-rows > .ak-row + .ak-row, .ak-block > .ak-row + .ak-row { border-top: 1px solid var(--line); }
.ak-grid + .ak-rows-after:not(:empty), .ak-rows:not(:empty) + .ak-grid:not(:empty) { border-top: 1px solid var(--line); }
/* one row: icon · name, one line, tags · control; «Подробнее» under it */
.ak-card .ak-line { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; padding: 11px 14px; margin: 0; border-top: 0; font-size: 14px; cursor: pointer; }
.ak-card .admin-row.ak-line { cursor: default; }
.ak-line > .ak-ico { align-self: start; margin-top: 1px; }
.ak-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ak-card .ak-label { display: block; font-weight: 650; line-height: 1.3; }
.ak-desc { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.ak-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.ak-tag { font-size: 11px; line-height: 1.5; padding: 0 7px; border-radius: 999px; background: rgba(255,255,255,.07); color: #c8cdd8; }
.ak-tag-warn { background: rgba(229,160,13,.14); color: #ffcf6b; }
.ak-tag-err { background: rgba(255,107,107,.15); color: #ff9b9b; }
.ak-tag-season { background: rgba(120,180,255,.12); color: #b9d6ff; }
.ak-ctl { display: flex; align-items: center; justify-content: flex-end; min-height: 40px; }
.ak-more { margin: -4px 14px 10px 48px; color: var(--muted); font-size: 12.5px; }
.ak-more summary { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; cursor: pointer; color: #c8cdd8; font-size: 12px; list-style: none; border-radius: 6px; }
.ak-more summary::-webkit-details-marker { display: none; }
.ak-more summary::before { content: ''; width: 0; height: 0; border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s ease; }
.ak-more[open] summary::before { transform: rotate(90deg); }
.ak-more summary:focus-visible { outline: 2px solid #ffd479; outline-offset: 2px; }
.ak-more .admin-hint { margin: 4px 0 0; white-space: pre-line; }
/* the switch: bigger, and its «off» track at 3:1 against the card (WCAG 1.4.11) */
.ak-card .admin-tog input[type=checkbox] { width: 44px; height: 24px; background: #6b7385; }
.ak-card .admin-tog input[type=checkbox]::after { top: 3px; left: 3px; }
.ak-card .admin-tog input[type=checkbox]:checked { background: var(--accent); }
.ak-card .admin-tog input[type=checkbox]:checked::after { transform: translateX(20px); }
.ak-card .admin-tog input[type=checkbox]:focus-visible { outline: 2px solid #ffd479; outline-offset: 3px; }
.ak-card .admin-select { min-height: 38px; max-width: 240px; }
.ak-card input.ak-input { width: 260px; max-width: 100%; text-align: left; }
/* rows dimmed by an «off» master switch */
.ak-row.ak-off { opacity: .45; }
.ak-row.ak-off .ak-line { cursor: not-allowed; }
/* mini tiles: games, shop items, pet things, season events */
.ak-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; padding: 10px 12px 12px; }
.ak-mini { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; min-width: 0; }
.ak-mini .ak-line { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 1px 9px; padding: 8px 8px 8px 10px; min-height: 52px; }
.ak-mini .ak-line > .ak-ico { align-self: center; margin: 0; }
.ak-mini .ak-pic { width: 28px; height: 28px; }
.ak-mini .ak-label { font-size: 13px; line-height: 1.25; }
.ak-mini .ak-desc { font-size: 11.5px; }
.ak-mini .ak-tags { margin-top: 2px; }
.ak-mini .ak-tag { font-size: 10.5px; padding: 0 6px; }
.ak-mini .ak-ctl { min-height: 36px; }
.ak-mini .ak-more { margin: -6px 10px 8px 45px; }
/* legacy rows (a file not yet registering): its old label/hint styles, inside the row padding */
.ak-legacy { padding: 4px 14px; }
.ak-legacy .admin-tog { border-top: 0; }
.ak-legacy .admin-tog-label i { display: none; }
.ak-legacy .ak-more { margin-left: 0; }
.ak-legacy.ak-mini { padding: 2px 10px; }
.ak-block { padding: 10px 14px; }
.ak-block > .ak-row { margin: 0 -14px; }
.ak-block .admin-hint:last-child { margin-bottom: 0; }
.ak-welcome-text { padding: 0 0 4px 34px; }
.ak-src-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ak-block .admin-msg { text-align: left; }
.ak-empty { margin: 28px 0; text-align: center; color: var(--muted); }
/* the save bar */
.ak-foot { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--panel); }
.ak-state { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; }
.ak-foot.ak-dirty .ak-state { color: #ffcf6b; font-weight: 650; }
.ak-foot .admin-msg { flex: 1; min-width: 0; margin: 0; min-height: 0; text-align: left; }
.ak-foot .admin-msg:empty { display: none; }
.ak-foot:has(.admin-msg:not(:empty)) .ak-state { display: none; }
.ak-btn { height: 42px; padding: 0 18px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; flex: none; }
.ak-btn:disabled { opacity: .45; cursor: default; }
.ak-btn:focus-visible { outline: 2px solid #ffd479; outline-offset: 2px; }
.ak-card .ak-pri, .ak-card .admin-save.ak-pri { width: auto; margin: 0; padding: 0 18px; background: var(--accent); color: #1a1205; border: 0; }
.ak-foot:not(.ak-dirty) .ak-pri { opacity: .72; }
@media (max-width: 760px) {
  .admin-modal:has(.ak-card) { padding: 0; }
  .admin-modal .admin-card.ak-card { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border: 0; }
  .ak-head { padding: 12px 12px 10px; }
  .ak-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); } /* not the chip row's width */
  .ak-nav { flex-direction: row; gap: 6px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; scrollbar-width: none; }
  .ak-nav::-webkit-scrollbar { display: none; }
  .ak-nav-b { width: auto; flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; }
  .ak-nav-t { overflow: visible; }
  .ak-main { padding: 2px 12px 24px; }
  .ak-grid { grid-template-columns: 1fr; }
  /* a select or an address goes under its name instead of squeezing it to two lines */
  .ak-card .admin-row.ak-line:has(select), .ak-card .admin-row.ak-line.ak-wide { grid-template-columns: 22px minmax(0, 1fr); }
  .ak-card .admin-row.ak-line:has(select) .ak-ctl, .ak-card .admin-row.ak-line.ak-wide .ak-ctl { grid-column: 2; justify-content: flex-start; min-height: 0; margin-top: 6px; }
  .ak-card .admin-row.ak-line .admin-select, .ak-card .admin-row.ak-line input.ak-input { width: 100%; max-width: none; }
  .ak-more { margin-left: 48px; }
  .ak-foot { padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .ak-btn, .ak-card .ak-pri { padding: 0 14px; }
}
@media (max-width: 360px) {
  .ak-undo { padding: 0 10px; }
  .ak-state { font-size: 12px; }
  .ak-foot:not(.ak-dirty) .ak-state { visibility: hidden; } /* «all saved» needs no room on the smallest phones */
  .ak-foot { flex-wrap: wrap; row-gap: 6px; }
  .ak-foot.ak-dirty .ak-state, .ak-foot .admin-msg:not(:empty) { flex: 1 0 100%; } /* the count on its own line, the buttons below */
  .ak-foot.ak-dirty .ak-btn { flex: 1 1 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ak-more summary::before { transition: none; }
}
