/* The subtab owns hidden; only expose its shell once the existing editor has content. */
#hunt .supply-window:has(> #configEditor:not([data-hunt-settings-mounted='true'])),
#hunt .supply-window:has(> #configEditor:empty) {
  display: none;
}

/* Hunt Settings V3. Scoped to .hunt-settings; reuses the Game UI Glass V1 tokens
 * (--glass-*) so player UI themes recolour it. Buttons carry .ro-ui-primitive to
 * opt out of the generic glass button skin in game-glass.css. */
.hunt-settings {
  --hs-ink: var(--glass-ink, #1c2a3a);
  --hs-sub: #4c5d72;
  --hs-blue: var(--glass-blue, linear-gradient(#6f9ad6, #3f69a8));
  --hs-green: linear-gradient(#5fcf8d, #2f9e62);
  --hs-line: rgb(255 255 255 / 62%);
  display: grid; gap: 10px; padding: 10px; color: var(--hs-ink);
  font: 15px/1.45 var(--glass-font, 'Microsoft JhengHei', 'PingFang TC', 'Noto Sans TC', sans-serif);
}
.hunt-settings * { box-sizing: border-box; }
.hunt-settings button { font: inherit; color: inherit; cursor: pointer; }
.hunt-settings button:disabled { cursor: default; opacity: .5; }
.hunt-settings .hs-summary { margin: 0; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--hs-line);
  background: rgb(255 255 255 / 45%); font-size: 13px; color: var(--hs-sub); }
.hunt-settings .hs-summary b { color: var(--hs-ink); }

.hunt-settings .hs-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid var(--hs-line);
  border-radius: 20px; background: rgb(255 255 255 / 40%); }
.hunt-settings .hs-seg > button { flex: 1 1 auto; min-height: 32px; padding: 0 12px; border: 0; border-radius: 16px;
  background: transparent; font-weight: 600; font-size: 14px; white-space: nowrap; }
.hunt-settings .hs-seg > button[aria-checked='true'] { background: var(--hs-blue); color: #fff;
  box-shadow: 0 2px 8px rgb(30 60 110 / 30%); text-shadow: 0 1px 2px rgb(10 20 40 / 30%); }
.hunt-settings .hs-seg.is-main { background: rgb(255 255 255 / 52%); box-shadow: 0 6px 18px rgb(10 20 40 / 14%); }
.hunt-settings .hs-seg.is-main > button { flex: 1 1 0; min-height: 40px; font-size: 16px; }

.hunt-settings .hs-card { overflow: hidden; border: 1px solid var(--hs-line); border-radius: 12px;
  background: rgb(255 255 255 / 40%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 55%); }
.hunt-settings .hs-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px;
  background: linear-gradient(rgb(90 130 190 / 55%), rgb(55 90 150 / 55%)); color: #fff; font-weight: 700;
  letter-spacing: .04em; text-shadow: 0 1px 2px rgb(10 20 40 / 45%); }
.hunt-settings .hs-card-head small { font-weight: 500; letter-spacing: 0; opacity: .9; }
.hunt-settings details > summary.hs-card-head { list-style: none; cursor: pointer; }
.hunt-settings details > summary.hs-card-head::-webkit-details-marker { display: none; }
.hunt-settings details > summary.hs-card-head::after { content: ''; flex: 0 0 auto; width: 8px; height: 8px; margin: -4px 4px 0 0;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); transition: transform .2s ease; }
.hunt-settings details[open] > summary.hs-card-head::after { transform: rotate(225deg); margin-top: 4px; }
.hunt-settings .hs-card-list { display: grid; }
.hunt-settings .hs-group { padding: 10px 12px 4px; font-size: 12px; font-weight: 700; color: var(--hs-sub); letter-spacing: .04em; }

.hunt-settings .hs-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  min-height: 52px; padding: 10px 12px; border-top: 1px solid rgb(255 255 255 / 55%); text-align: left; }
.hunt-settings .hs-group + .hs-row { border-top: 0; }
.hunt-settings .hs-ico { display: grid; place-items: center; width: 30px; height: 30px; overflow: hidden; border-radius: 8px;
  border: 1px solid rgb(255 255 255 / 75%); background: rgb(255 255 255 / 60%); }
.hunt-settings .hs-ico img { width: 24px; height: 24px; image-rendering: pixelated; }
.hunt-settings .hs-ico.is-empty { border-style: dashed; border-color: rgb(60 90 130 / 35%); background: rgb(255 255 255 / 30%); }
.hunt-settings .hs-ico.is-sym { color: #3f69a8; font-size: 16px; font-weight: 800; }
.hunt-settings .hs-txt { display: grid; gap: 1px; min-width: 0; }
.hunt-settings .hs-txt b { font-size: 15px; }
.hunt-settings .hs-txt small { font-size: 12px; color: var(--hs-sub); }
.hunt-settings .hs-ctl { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.hunt-settings .hs-row.is-stack { row-gap: 6px; }
.hunt-settings .hs-below { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-left: 40px; }
.hunt-settings .hs-row.is-locked .hs-ctl { color: var(--hs-sub); font-size: 13px; font-weight: 700; }
.hunt-settings .hs-note { margin: 0; padding: 8px 12px 12px; font-size: 12px; color: var(--hs-sub); }

.hunt-settings .hs-switch { position: relative; flex: 0 0 auto; width: 51px; height: 31px; }
.hunt-settings .hs-switch input { position: absolute; inset: 0; z-index: 1; margin: 0; opacity: 0; cursor: pointer; }
.hunt-settings .hs-switch span { position: absolute; inset: 0; border-radius: 16px; background: rgb(120 135 155 / 35%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 55%); transition: background .2s; }
.hunt-settings .hs-switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgb(10 20 40 / 30%); transition: transform .2s; }
.hunt-settings .hs-switch input:checked + span { background: var(--hs-green); }
.hunt-settings .hs-switch input:checked + span::after { transform: translateX(20px); }

.hunt-settings .hs-slider { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 180px; }
.hunt-settings .hs-slider input[type='range'] { flex: 1; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; }
.hunt-settings .hs-slider input[type='range']::-webkit-slider-runnable-track { height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #4f7bbd var(--p, 50%), rgb(255 255 255 / 70%) var(--p, 50%)); box-shadow: inset 0 0 0 1px rgb(60 90 130 / 20%); }
.hunt-settings .hs-slider input[type='range']::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -10px; border: 0; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgb(10 20 40 / 35%); -webkit-appearance: none; }
.hunt-settings .hs-slider input[type='range']::-moz-range-track { height: 6px; border-radius: 3px; background: rgb(255 255 255 / 70%); }
.hunt-settings .hs-slider input[type='range']::-moz-range-progress { height: 6px; border-radius: 3px; background: #4f7bbd; }
.hunt-settings .hs-slider input[type='range']::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(10 20 40 / 35%); }
.hunt-settings .hs-val { min-width: 52px; padding: 4px 6px; border-radius: 9px; background: rgb(255 255 255 / 65%);
  color: #2c5491; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }

.hunt-settings .hs-step { display: flex; align-items: center; border: 1px solid rgb(255 255 255 / 75%); border-radius: 17px;
  background: rgb(255 255 255 / 60%); box-shadow: 0 2px 6px rgb(10 20 40 / 10%); }
.hunt-settings .hs-step button { width: 36px; height: 34px; border: 0; background: transparent; color: #3f69a8; font-size: 18px; font-weight: 800; }
.hunt-settings .hs-step output { min-width: 44px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.hunt-settings .hs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hunt-settings .hs-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 12px; border-radius: 15px;
  border: 1px solid rgb(255 255 255 / 75%); background: rgb(255 255 255 / 50%); font-size: 13px; font-weight: 600; }
.hunt-settings .hs-chip[aria-pressed='true'] { border-color: rgb(255 255 255 / 80%); background: var(--hs-blue); color: #fff; }
.hunt-settings .hs-chip.is-lock { border-color: rgb(47 158 98 / 30%); background: rgb(47 158 98 / 18%); color: #1f6b42; }
.hunt-settings .hs-chip.is-remove { color: #a12d39; }
.hunt-settings .hs-chip img { width: 18px; height: 18px; image-rendering: pixelated; }
.hunt-settings .hs-pill { min-height: 34px; padding: 0 14px; border: 1px solid rgb(255 255 255 / 70%); border-radius: 17px;
  background: rgb(255 255 255 / 55%); box-shadow: 0 2px 6px rgb(10 20 40 / 12%); font-size: 14px; font-weight: 600; }
.hunt-settings .hs-pill.is-blue { background: var(--hs-blue); color: #fff; text-shadow: 0 1px 2px rgb(10 20 40 / 30%); }
.hunt-settings .hs-pill:active, .hunt-settings .hs-chip:active, .hunt-settings .hs-step button:active { transform: scale(.95); }
.hunt-settings .hs-add { display: flex; justify-content: center; padding: 10px 12px; border-top: 1px solid rgb(255 255 255 / 55%); }

.hunt-settings .hs-savebar { position: sticky; bottom: 8px; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px;
  border: 1px solid var(--hs-line); border-radius: 24px; background: rgb(255 255 255 / 72%);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); box-shadow: 0 8px 22px rgb(10 20 40 / 20%); }
.hunt-settings .hs-savebar .hs-status { flex: 1; min-width: 0; }
.hunt-settings .hs-status { margin: 0; font-size: 13px; font-weight: 600; color: var(--hs-sub); }
.hunt-settings .hs-status.is-dirty, .hunt-settings .hs-status.is-warn { color: #8a5a00; }
.hunt-settings .hs-status.is-ok { color: #1f7a49; }
.hunt-settings .hs-status.is-error { color: #a12d39; }
.hunt-settings.is-readonly .hs-card { opacity: .75; }
.hunt-settings.is-readonly .hs-card button, .hunt-settings.is-readonly .hs-card input { pointer-events: none; }

.hunt-settings.hs-sheet-host { display: contents; }
.hunt-settings .hs-sheet { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; background: rgb(10 20 40 / 35%); }
.hunt-settings .hs-sheet-card { display: flex; flex-direction: column; width: min(560px, 100vw); max-height: 78dvh; overflow: hidden;
  border: 1px solid var(--hs-line); border-radius: 18px 18px 0 0; background: rgb(255 255 255 / 85%);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
.hunt-settings .hs-sheet-card header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-size: 16px; }
.hunt-settings .hs-sheet-list { overflow: auto; padding-bottom: 16px; }
.hunt-settings .hs-pick { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.hunt-settings .hs-check { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid rgb(63 105 168 / 45%); color: #fff; font-size: 14px; font-weight: 900; }
.hunt-settings .hs-check.is-on { border-color: transparent; background: var(--hs-blue); }

/* G8L-222 supply weight sliders: 44px touch targets, big thumbs, budget bar. */
.hunt-settings .sw-budget { display: grid; gap: 6px; padding: 8px 12px 10px; }
.hunt-settings .sw-bar { display: flex; height: 14px; overflow: hidden; border-radius: 7px; background: rgb(255 255 255 / 70%);
  box-shadow: inset 0 0 0 1px rgb(60 90 130 / 25%); }
.hunt-settings .sw-seg { display: block; width: 0; height: 100%; }
.hunt-settings .sw-seg.is-bag { background: repeating-linear-gradient(45deg, #8a97a8 0 4px, #a9b4c2 4px 8px); }
.hunt-settings .sw-c1 { background: #d9474f; } .hunt-settings .sw-c2 { background: #ee8a2a; }
.hunt-settings .sw-c3 { background: #e5c22b; } .hunt-settings .sw-c4 { background: #c9d3df; }
.hunt-settings .sw-c5 { background: #8a6bd1; }
.hunt-settings .sw-legend { margin: 0; font-size: 13px; font-weight: 700; color: var(--hs-sub); font-variant-numeric: tabular-nums; }
.hunt-settings .sw-legend.is-over { color: #a12d39; }
.hunt-settings .sw-estimate { margin: 0; font-size: 15px; font-weight: 900; color: #2c5491; font-variant-numeric: tabular-nums; }
.hunt-settings .sw-zeny { margin: 0; padding: 6px 10px; border-radius: 8px; background: rgb(255 236 200 / 85%); color: #8a4b00; font-size: 13px; font-weight: 800; }
.hunt-settings .sw-estimate[hidden], .hunt-settings .sw-zeny[hidden] { display: none; }
.hunt-settings .sw-slider { min-width: 0; }
.hunt-settings .sw-slider input[type='range'] { height: 44px; touch-action: pan-y; }
.hunt-settings .sw-slider input[type='range']::-webkit-slider-runnable-track { height: 10px; border-radius: 5px; }
.hunt-settings .sw-slider input[type='range']::-webkit-slider-thumb { width: 34px; height: 34px; margin-top: -12px; }
.hunt-settings .sw-slider input[type='range']::-moz-range-track, .hunt-settings .sw-slider input[type='range']::-moz-range-progress { height: 10px; border-radius: 5px; }
.hunt-settings .sw-slider input[type='range']::-moz-range-thumb { width: 34px; height: 34px; }
.hunt-settings .sw-num { gap: 4px; font-weight: 800; color: #2c5491; }
.hunt-settings .sw-num input { width: 84px; height: 44px; padding: 0 8px; border: 1px solid rgb(255 255 255 / 80%); border-radius: 10px;
  background: rgb(255 255 255 / 75%); color: #2c5491; font: inherit; font-size: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.hunt-settings .hs-savebar .hs-pill { min-height: 44px; }

@media (max-width: 420px) {
  .hunt-settings { padding: 6px; gap: 8px; }
  .hunt-settings .hs-row { gap: 8px; padding: 9px 10px; }
  .hunt-settings .hs-below { padding-left: 0; }
  .hunt-settings .hs-val { min-width: 46px; }
  .hunt-settings .hs-slider { min-width: 0; }
  .hunt-settings .sw-num input { width: 76px; }
}

/* Keep mobile settings text and controls clear; other pages retain the pet. */
@media (max-width: 650px) {
  body:has(#hunt.active [data-subtab-group='settings']:not([hidden])) #petCompanion {
    display: none;
  }
}
