/* 설정 (index.html #tab-settings, js/features/settings.js): the list of parts and the part picked (user, 2026-11-29: 「설정이 지금
   너무 난잡함 … 카테고리별로 나눠서 카테고리 선택하면 해당 설정들 뜨도록 해」).  PC: the list on the left (it stays in sight), the
   part on the right; phone (720 px wide or less): the list, then the part with 「‹」 back.  In a part every setting is one line - its
   name on the left, its control on the right - whichever file draws it (the hosts: settings.js header). */
.set-wrap { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 28px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 2px; }
@media (min-height: 600px) { .set-nav { position: sticky; top: calc(var(--topbar-h) + 14px); } }   /* (a low window - a phone on its side: the list scrolls with the page) */
.set-nav button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 6px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 14px; text-align: left; white-space: normal; }
.set-nav button:hover:not(:disabled) { background: var(--panel2); color: var(--fg); }
.set-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.set-nav button[aria-current="true"] { background: var(--panel3); color: var(--fg); box-shadow: inset 3px 0 0 var(--accent); }
.set-nav button[aria-current="true"] > .ico-mask:first-child { color: var(--accent); }
.set-nav .ico-mask { width: 18px; height: 18px; }
.set-nav .set-t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.set-nav .set-t b { font-weight: 500; }
.set-nav small, .set-nav .set-go { display: none; }
.set-panel { display: none; min-width: 0; max-width: 640px; }
.set-panel.on { display: block; }
.set-top { display: none; }

/* one setting a line */
.set-panel [hidden] { display: none !important; }
.set-panel .row { margin: 0; row-gap: 0; column-gap: 10px; }
.set-panel label.toggle, .set-panel label.inline, .set-panel .set-line {
  display: flex; flex: 1 1 100%; width: 100%; box-sizing: border-box; align-items: center; gap: 12px; min-height: 46px; padding: 6px 0;
  border-bottom: 1px solid var(--line); font-size: 14px; }
.set-panel label.toggle { flex-direction: row-reverse; justify-content: space-between; cursor: pointer; }
.set-panel label.toggle > input[type=checkbox] { width: 18px; height: 18px; margin: 0 2px 0 0; flex: none; accent-color: var(--accent); }
.set-panel label.inline > select, .set-panel label.inline > input, .set-panel .set-line > .fp { margin-left: auto; }
.set-panel label.inline > select { max-width: 64%; min-width: 0; }
.set-panel label.inline > input[type=range] { width: min(190px, 38vw); }
.set-panel label.inline > input[type=range] + span { min-width: 3em; text-align: right; }
.set-panel label.inline > input[type=text] { width: 7em; box-sizing: border-box; background: var(--panel2); color: var(--fg); border: 1px solid var(--line2); border-radius: 6px;
  padding: 4px 6px; font: inherit; font-size: 13px; }
.set-panel p.muted, .set-panel .row > span.muted { margin: 8px 0; }
.set-panel h4 { margin: 22px 0 6px; font-size: 14px; color: var(--accent); }
.set-panel > .set-top + * > :first-child { margin-top: 0; }

/* the parts' own pieces */
#common-settings .row > span.muted.small { flex: 1 1 100%; }                          /* 조작: 「조이스틱을 읽지 않는 게임은 …」 */
#touch-settings > button { margin: 10px 0 0; }                                         /* 터치: 버튼 위치 처음대로 */
.set-panel .rc-landpick { flex: 1 1 100%; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }   /* 터치: 가로 화면 왼쪽 위 버튼 */
#sync-settings > button, #sync-settings > #sync-state { margin-top: 8px; }             /* 저장·동기화: 지금 동기화 · 마지막 동기화 */
#sync-settings > #sync-state:empty { display: none; }
#sync-files-settings:empty { display: none; }                                          /* 저장·동기화: the game files' sync (its own file fills it) */
.set-panel .fp-row .set-line:last-of-type { border-bottom: 0; }                        /* 글꼴: 내 글꼴 파일 올리기, then the files */
.set-panel .fp-files { margin: 2px 0 8px; }
#sound-store { min-height: 46px; padding: 6px 0; border-bottom: 1px solid var(--line); row-gap: 8px; }   /* 소리: 저장된 사운드폰트 */
#sound-store > span:first-child { margin-right: auto; font-size: 14px; }
#sound-store .sf-pick { flex: 1 1 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-bottom: 6px; }
.set-panel .sf-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.set-panel .sf-item label.toggle { flex: 0 1 auto; width: auto; min-height: 0; padding: 0; border: 0; flex-direction: row; font-size: 13px; }
.set-panel .fold-row { min-height: 46px; padding: 6px 0; row-gap: 8px; border-bottom: 1px solid var(--line); }   /* 고급: 폴더 */
.set-panel .fold-row > span:first-child { margin-right: auto; font-size: 14px; color: var(--fg); }
.set-panel details.emulog > summary { padding: 13px 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }   /* 고급: 에뮬레이터 로그 */
.set-panel details.emulog[open] > .row { margin: 8px 0; }
.set-panel[data-cat="cache"] table.cache { margin-bottom: 4px; }                         /* CD 캐시 */
.set-panel[data-cat="cache"] .row, #save-data .row { margin: 10px 0; row-gap: 8px; }
.set-panel[data-cat="info"] > p:first-of-type { margin-top: 0; }

@media (max-width: 720px) {
  .set-wrap { display: block; }
  .set-wrap[data-view="list"] .set-panels { display: none; }
  .set-wrap[data-view="part"] .set-nav { display: none; }
  .set-nav { position: static; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .set-nav button { min-height: 58px; padding: 8px 12px 8px 14px; gap: 12px; border-radius: 0; color: var(--fg); }
  .set-nav button + button { border-top: 1px solid var(--line); }
  .set-nav button:hover:not(:disabled) { background: transparent; }
  .set-nav button[aria-current="true"] { background: transparent; box-shadow: none; }
  .set-nav button[aria-current="true"] b { color: var(--accent); }
  .set-nav .ico-mask { width: 20px; height: 20px; color: var(--muted); }
  .set-nav .set-t b { font-size: 15px; font-weight: 600; }
  .set-nav small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .set-nav .set-go { display: inline-block; width: 16px; height: 16px; }
  .set-panel { max-width: none; }
  .set-top { display: flex; align-items: center; gap: 2px; min-height: 44px; margin: -6px 0 4px -8px; }
  .set-top h3 { margin: 0; font-size: 17px; color: var(--fg); }
  .set-back { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: var(--fg); }
  .set-back .ico-mask { width: 22px; height: 22px; }
  .set-panel label.toggle, .set-panel label.inline, .set-panel .set-line { min-height: 50px; font-size: 14.5px; }
  .set-panel select { min-height: 40px; }
  .set-panel label.inline > input[type=text] { min-height: 40px; font-size: 16px; }   /* (16 px: iOS does not zoom in) */
}
