/* Character page (pages/character.html, assets/js/character.js), loaded after roster.css. One long page, no tabs:
   a two-column hero at 1024 px and up (the "stage": card art with the name plate, form chips and mode button on it;
   the "Status" panel), stacked below; then full-width panels (Jutsu, Abilities, Awaken & Limit Break, Stats by level,
   Where to get, Counters, What it has). Game art is shown as it is: no filters, blends or colour overlays on it. */

/* ---------- top bar: Roster, position in the list, Prev / Next ---------- */
.ch-bar .wrap { gap: 10px; }
.ch-pos { flex: 1 1 auto; min-width: 0; text-align: center; color: var(--faint); font: 600 0.85rem var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-pos:empty { visibility: hidden; }
.ch-wrap { padding-top: 16px; }

/* ---------- hero ---------- */
.cp-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: stretch; }

/* stage: the art fills it; plate (top left), forms (top right), mode button (bottom left) sit on it */
.cp-stage { position: relative; min-width: 0; height: 360px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--el, #444) 34%, transparent), transparent 68%), #0e0b12; }
.cp-art { position: absolute; inset: 10px 10px 0; }
.cp-art img.card-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
.cp-art img.card-icon { inset: 25%; width: 50%; height: 50%; object-position: 50% 50%; }
.cp-art .sk-art { width: 100%; height: 100%; border-radius: 12px; }
.cp-plate { position: absolute; left: 14px; top: 12px; z-index: 2; max-width: min(64%, 420px); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; pointer-events: none; }
.cp-plate a, .cp-plate .ttag { pointer-events: auto; }
.cp-no { margin: 0; display: flex; align-items: center; gap: 8px; min-height: 18px; color: var(--gold); font: 700 0.78rem/1 var(--sans); text-shadow: 0 1px 3px #000; }
.cp-no::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--el, var(--orange)); }
.cp-no .stars img { width: 13px; height: 13px; }
.cp-plate h1 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.6rem); line-height: 1.02; overflow-wrap: anywhere; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85), 0 0 2px #000; }
.cp-title { margin: 2px 0 0; padding: 4px 10px; border-radius: 999px; background: rgba(12, 10, 16, 0.82); border: 1px solid var(--line-2); font: 700 0.8rem/1.25 var(--sans); color: var(--text); }
.cp-title:empty { display: none; }
.cp-types { display: flex; flex-wrap: wrap; gap: 4px; }
.cp-types .ttag { font-size: 0.66rem; padding: 4px 7px; background-color: rgba(12, 10, 16, 0.82); }
.cp-forms { position: absolute; right: 10px; top: 10px; z-index: 2; max-width: 46%; }
.cp-forms .form-switch { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(12, 10, 16, 0.78); }
.cp-forms .fs-item { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 50px; min-height: 44px; padding: 3px 6px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--muted); }
.cp-forms .fs-item:hover { border-color: var(--line-2); color: var(--text); }
.cp-forms .fs-item[aria-current="page"] { border-color: var(--gold); background: rgba(255, 201, 74, 0.1); color: var(--text); }
.cp-forms .fs-item .fs-rar { width: 38px; height: auto; border-radius: 0; }
.cp-forms .fs-item small { font: 700 0.6rem/1.1 var(--sans); white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }  /* "Blazing Awakened" fits whole */
.cp-forms .fs-item .stars img { width: 10px; height: 10px; }
.cp-modebox { position: absolute; left: 12px; bottom: 12px; z-index: 2; }
.cp-mode { display: inline-flex; align-items: center; gap: 9px; min-height: 48px; padding: 4px 16px 4px 5px; border-radius: 999px; border: 1px solid var(--gold); background: rgba(12, 10, 16, 0.88); color: var(--text); cursor: pointer; font: 700 0.9rem/1.1 var(--sans); text-align: left; }
.cp-mode:hover { background: rgba(30, 24, 36, 0.95); }
.cp-mode:focus-visible { outline: 2px solid var(--orange-2); outline-offset: 2px; }
.cp-mode-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: #1f0e00; flex: none; }
.cp-mode-t { display: grid; }
.cp-mode-t small { font: 700 0.6rem/1.2 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.cp-hero[data-mode="pvp"] .cp-mode { border-color: var(--orange-2); }
.cp-hero[data-mode="pvp"] .cp-mode-ico { background: var(--orange-2); }
.sk-mode { display: block; width: 150px; height: 48px; border-radius: 999px; }
.sk-no { display: block; width: 120px; height: 14px; }

/* ---------- Status panel ---------- */
.cp-status { min-width: 0; overflow-wrap: break-word; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 16px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.cp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; }
.cp-head h2 { min-width: 0; }
.cp-head h2, .cp-ph h2 { margin: 0; display: flex; align-items: center; gap: 10px; font: 700 1.08rem/1.1 var(--head, var(--sans)); }
.cp-head h2::before, .cp-ph h2::before { content: ""; width: 3px; height: 18px; border-radius: 2px; background: var(--gold); flex: none; }
.cp-head h2 small, .cp-ph > small { padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--muted); font: 700 0.62rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: 0.08em; }
.cp-head .ch-rate { display: flex; align-items: center; gap: 8px; min-height: 0; flex-wrap: nowrap; margin-left: auto; }
.cp-head .ch-rate[hidden] { display: none; }
.cp-head .ch-rate-h { font: 700 0.58rem/1.15 var(--sans); width: auto; max-width: 7.5em; text-align: right; margin: 0; }
.cp-tiers { display: flex; gap: 4px; }
.cp-tier { display: grid; justify-items: center; align-content: center; gap: 1px; min-width: 50px; min-height: 48px; padding: 2px 6px; border-radius: 9px; background: var(--surface-2, var(--bg-2)); color: var(--text); }
.cp-tier:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.cp-tier small { font: 700 0.6rem/1.1 var(--sans); color: var(--muted); white-space: nowrap; }
.cp-tier .ch-tier-img { width: 20px; height: 28px; object-fit: contain; }
.cp-tier-b { min-width: 26px; text-align: center; padding: 3px 6px; border-radius: 6px; background: var(--tier, var(--gold)); color: #16121c; font-size: 0.8rem; }
.cp-tier-none { color: var(--faint); font-weight: 700; line-height: 28px; }

/* identity: medal (card icon + level), the label / value list, the switches */
.cp-id { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "medal dl" "ctl ctl"; gap: 10px 14px; align-items: start; }
.cp-medal { grid-area: medal; position: relative; width: 96px; height: 108px; }
.cp-medal img, .cp-medal .noicon { display: block; width: 96px; height: 96px; border-radius: 12px; }
.cp-lv { position: absolute; left: 8px; right: 8px; bottom: 0; display: block; padding: 2px 0; border-radius: 7px; border: 1px solid var(--line-2); background: #14111a; text-align: center; font: 800 0.86rem/1.2 var(--sans); white-space: nowrap; }
.cp-lv small { font-size: 0.66rem; color: var(--muted); }
.cp-lv-lb { border-color: var(--orange-2); color: var(--orange-2); }
.sk-medal { display: block; width: 96px; height: 96px; border-radius: 12px; }
.cp-dl { grid-area: dl; margin: 0; display: grid; gap: 6px; align-content: start; min-height: 96px; }
.cp-dl > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; align-items: center; }
.cp-dl > .id-get { align-items: start; }
.cp-dl > .id-get dt { padding-top: 3px; }
.cp-dl dt { font: 700 0.64rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.cp-dl dd { margin: 0; font-weight: 700; font-size: 0.9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; overflow-wrap: anywhere; }
.cp-dl .id-get dd { display: block; font-weight: 500; font-size: 0.86rem; color: var(--muted); line-height: 1.4; }
.id-el, .id-aff { display: inline-flex; align-items: center; gap: 5px; }
.id-el img, .id-aff img { display: block; width: 20px; height: 20px; }
.id-el-note { display: block; margin-top: 4px; color: var(--muted); font-size: var(--fs-xs); line-height: 1.45; }
.sk-dt { display: block; width: 60px; height: 10px; }
.sk-dd { display: block; width: 110px; height: 16px; }
.cp-ctl { grid-area: ctl; min-width: 0; }
.cp-ctl:empty { display: none; }
/* the level picker's place while the page loads (nearly every unit has one): no jump when it arrives */
.sk-ctl { display: block; width: 100%; max-width: 100%; height: 80px; border-radius: 10px; }   /* picker 40 + gap 8 + slider 32 */
.st-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-lb { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 6px 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--muted); font: 700 0.82rem var(--sans); cursor: pointer; }
.st-sw { position: relative; width: 34px; height: 20px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); transition: background 0.15s; }
.st-sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #d8d2e0; transition: transform 0.15s; }
.st-lb[aria-pressed="true"] { border-color: var(--orange-2); color: var(--text); }
.st-lb[aria-pressed="true"] .st-sw { background: var(--orange-2); }
.st-lb[aria-pressed="true"] .st-sw::after { transform: translateX(14px); background: #fff; }
.st-lb:focus-visible, .st-lv select:focus-visible { outline: 2px solid var(--orange-2); outline-offset: 2px; }
.st-lv { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; font: 700 0.66rem var(--sans); color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.st-lv select { min-height: 40px; max-width: min(230px, 100%); padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2, var(--bg-2)); color: var(--text); font: 600 0.86rem var(--sans); text-transform: none; letter-spacing: 0; }

/* stat cards + one fact row */
.ch-stat { min-width: 0; display: grid; gap: 8px; min-height: 128px; align-content: start; }
.st-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); gap: 8px; }
.st-card { position: relative; min-width: 0; padding: 9px 12px 10px; border-radius: 12px; background: var(--surface-2, var(--bg-2)); }
.st-card small { display: block; color: var(--faint); font: 700 0.66rem var(--sans); text-transform: uppercase; letter-spacing: 0.08em; }
.st-card b { display: block; margin-top: 2px; font-family: var(--head); font-size: 1.7rem; line-height: 1.05; }
.st-pill { position: absolute; right: 8px; top: 7px; padding: 2px 8px; border-radius: 999px; background: rgba(61, 220, 132, 0.12); color: #6be29f; font: 800 0.7rem var(--sans); font-style: normal; }
/* facts: up to four on one row even in the narrow two-column Status panel (labels wrap instead of running out) */
.ch-stat .st-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 76px), 1fr)); gap: 6px; }
.ch-stat .st-facts .statbox { min-width: 0; padding: 7px 10px; border-radius: 10px; background: var(--surface-2, var(--bg-2)); border: 0; }
.ch-stat .st-facts .statbox small { display: block; font-size: 0.62rem; letter-spacing: 0.06em; line-height: 1.2; }
.ch-stat .st-facts .statbox b { font-size: 1.05rem; overflow-wrap: anywhere; }
.sk-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sk-tiles .sk { height: 62px; border-radius: 12px; }

/* Field / Buddy and Sync Skills: compact rows */
.ch-skills { display: grid; gap: 10px; min-width: 0; }
.ch-skills:empty { display: none; }
.st-sec h3 { margin: 0 0 6px; font: 700 0.66rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); }
.st-sec h3 .badge, .st-sec h3 .ch-same { margin-left: 6px; text-transform: none; letter-spacing: 0; }
.sk-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.skrow { min-width: 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2, var(--bg-2)); font-size: 0.86rem; }
.sk-t { margin: 0; font: 700 0.9rem/1.3 var(--sans); }
.sk-t .badge { margin-left: 4px; }
.sk-t .ch-same { font-size: 0.74rem; }
.sk-k { margin-left: 4px; color: var(--faint); font-weight: 600; font-size: 0.76rem; }
.sk-orb { display: inline-block; width: 15px; height: 15px; vertical-align: -2px; margin: 0 3px 0 2px; }
.skrow p { margin: 2px 0 0; color: var(--muted); line-height: 1.4; }
.sk-skills { height: 110px; border-radius: 10px; }

/* numbers inside effect texts */
.hn { display: inline-block; padding: 0 5px; border-radius: 5px; background: rgba(255, 201, 74, 0.16); color: var(--gold); font-weight: 800; white-space: nowrap; line-height: 1.35; }

/* ---------- panels under the hero ---------- */
.cp-body { margin-top: 14px; display: grid; gap: 14px; min-width: 0; min-height: 300px; }
.cp-sec { display: grid; gap: 14px; min-width: 0; }
.cp-panel { min-width: 0; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); scroll-margin-top: calc(var(--hdr, 64px) + 72px); }
.cp-sec { scroll-margin-top: calc(var(--hdr, 64px) + 72px); }
.cp-ph { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 18px 10px; }
.cp-pb { padding: 0 18px 18px; display: grid; gap: 12px; min-width: 0; }
.cp-pb > p, .cp-pb > .stat-notes { margin: 0; }
.cp-body .status-box { margin: 0; }
/* PvP ban box: the title and the server's rule each on their own line */
.ch-ban b, .ch-ban span { display: block; overflow-wrap: anywhere; }
.ch-ban span { margin-top: 4px; color: var(--muted); }
.cp-body .ch-mode-note { margin: 0; }
/* the old in-tab cards inside a panel: no box in a box */
.cp-panel .ch-card { padding: 0; border: 0; background: none; border-radius: 0; }
.cp-panel .ch-card h3 { margin: 0 0 8px; font: 700 0.68rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); }
.cp-panel .src-other { margin: 4px 0 0; font: 700 0.68rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); }
.cp-panel .stat-notes { color: var(--muted); font-size: 0.84rem; }
.sk-jband { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 10px; padding: 16px; }
.sk-jband .sk { height: 170px; border-radius: 14px; }

/* jutsu cards: a coloured header band (kind, name, chakra gauge), then the text, effect tags and metric cells */
.jband { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 12px; }
.jcard { min-width: 0; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--surface-2, var(--bg-2)); border: 1px solid var(--line); --jk: #2a63c4; --jk2: #173a7a; }
.jcard.jk-sec { --jk: #c23434; --jk2: #6e1717; }
.jcard.jk-lat { --jk: #8a46cc; --jk2: #45206b; }
.jc-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "kind chakra" "name chakra"; align-items: center; gap: 2px 12px; min-height: 64px; padding: 9px 12px 9px 16px;
  background: linear-gradient(100deg, var(--jk2), var(--jk) 70%); border-bottom: 2px solid color-mix(in srgb, var(--jk) 70%, #fff); }
.jc-kind { grid-area: kind; font: italic 800 0.76rem/1.2 var(--head, var(--sans)); letter-spacing: 0.04em; text-transform: uppercase; color: #ffe39a; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.jc-kind .badge, .jc-kind .ch-same { margin-left: 6px; font-style: normal; text-transform: none; letter-spacing: 0; text-shadow: none; }
.jc-kind .ch-same { color: rgba(255, 255, 255, 0.75); }
.jc-name { grid-area: name; margin: 0; font: 800 1.02rem/1.25 var(--sans); color: #fff; overflow-wrap: anywhere; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.jc-chakra { grid-area: chakra; display: flex; flex-direction: column-reverse; align-items: center; justify-content: center; width: 54px; height: 46px; border-radius: 12px; background: rgba(8, 10, 20, 0.6); border: 2px solid rgba(255, 255, 255, 0.35); }
.jc-chakra b { font: 800 1.2rem/1 var(--head, var(--sans)); color: #fff; }
.jc-chakra small { font: 800 0.5rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.75); }
.jc-body { display: grid; gap: 8px; padding: 10px 14px 12px; }
.jc-text { margin: 0; color: var(--text); font-size: 0.93rem; line-height: 1.5; }
.jc-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.jc-tags li { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); font: 600 0.72rem var(--sans); color: var(--muted); }
.jc-cells { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 90px), 1fr)); gap: 6px; }
.jc-cells div { background: var(--surface-3, var(--panel)); border-radius: 8px; padding: 6px 9px; }
.jc-cells dt { font: 700 0.62rem var(--sans); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.jc-cells dd { margin: 0; font-weight: 700; }

/* abilities: unlock step, name, effect */
.ch-abil .abil { margin: 0; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 8px; }
.ch-abil .abil li { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "u n" "u d"; column-gap: 10px; align-items: start; padding: 8px 12px 9px 8px; border-radius: 10px; background: var(--surface-2, var(--bg-2)); }
.ch-abil .abil .ab-n { grid-area: n; }
.ch-abil .abil .ab-d { grid-area: d; color: var(--muted); }
.ch-abil .abil .ab-u { grid-area: u; display: grid; place-items: center; width: 34px; height: 34px; margin: 1px 0 0; padding: 0; border-radius: 50%; background: rgba(255, 201, 74, 0.12); color: var(--gold); font: 800 0.86rem/1 var(--sans); font-style: normal; }
.ch-abil .abil .ab-of { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Awaken & Limit Break: recipes, then where to get the materials ---------- */
.rc { display: grid; gap: 14px; min-width: 0; }
.rc + .rc { padding-top: 14px; border-top: 1px solid var(--line); }
.rc-h { margin: 0 0 8px; font: 700 0.68rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); }
.rc-h small { margin-left: 4px; padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--muted); font-size: 0.66rem; letter-spacing: 0.04em; }
.rc-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.rc-mats { display: flex; flex-wrap: wrap; gap: 10px; }
.rc-op { align-self: center; display: grid; place-items: center; width: 30px; height: 30px; margin-top: -18px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--muted); font-size: 1rem; }
.rc-tile { display: grid; justify-items: center; align-content: start; gap: 4px; width: 92px; min-height: 44px; color: var(--text); text-align: center; }
.rc-tile:hover { color: var(--text); }
.rc-tile:hover img { outline: 2px solid var(--line-2); }
.rc-form img, .rc-form .noicon { width: 64px; height: 64px; border-radius: 10px; }
.rc-form[aria-current="page"] img { outline: 2px solid var(--gold); outline-offset: 1px; }
.rc-ico { position: relative; display: block; }
.rc-mat img, .rc-mat .noicon { width: 56px; height: 56px; border-radius: 9px; }
.rc-n { position: absolute; right: -6px; bottom: -4px; padding: 1px 6px; border-radius: 999px; background: #14111a; border: 1px solid var(--line-2); font: 800 0.72rem/1.3 var(--sans); }
.rc-name { font: 600 0.7rem/1.25 var(--sans); color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ch-farm:empty { display: none; }
.farm-h { margin: 0 0 8px; font: 700 0.68rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); }
.farm-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 6px; }
.farm { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 44px; padding: 6px; border-radius: 10px; background: var(--surface-2, var(--bg-2)); border: 1px solid var(--line); color: var(--text); }
.farm:hover { border-color: var(--line-2); color: var(--text); }
.farm-art { width: 128px; height: auto; aspect-ratio: 256 / 65; object-fit: cover; border-radius: 6px; }
.farm:not(:has(.farm-art)) { grid-template-columns: minmax(0, 1fr); }
.farm-t { display: grid; gap: 1px; min-width: 0; font-size: 0.86rem; }
.farm-t b { overflow-wrap: anywhere; }
.farm-mat { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 0.78rem; overflow-wrap: anywhere; }
.farm-mat img { width: 24px; height: 24px; flex: none; }
.farm-m { color: var(--muted); font-size: 0.8rem; }
.farm-m .badge { margin-left: 4px; }
.farm-lucky { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 201, 74, 0.14); color: var(--gold); font: 700 0.7rem var(--sans); }
.farm-note { margin: 6px 0 0; color: var(--faint); font-size: 0.78rem; }
.cp-panel .evo-links + .stat-notes, .cp-panel h3 + .evo-links { margin-top: 0; }

/* ---------- Stats by level ---------- */
.cp-body .statbars.tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); margin: 0; }
.cp-body .table-scroll { margin: 0; }
.cp-body table.stat-table tbody th { text-align: left; font-weight: 600; white-space: normal; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.cp-body table.stat-table tbody th small { display: block; color: var(--faint); font-weight: 400; font-size: 0.74rem; }
.cp-body table.stat-table tr.ult th { color: var(--gold); background: rgba(255, 201, 74, 0.06); }
.cp-body[data-mode="pvp"] table.stat-table thead th { color: var(--orange-2); }

/* ---------- What it has: the list folds away ---------- */
.cp-parts > summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; margin-top: 10px; border-radius: 999px; border: 1px solid var(--line-2); cursor: pointer; font: 700 0.84rem var(--sans); color: var(--text); list-style: none; }
.cp-parts > summary::-webkit-details-marker { display: none; }
.cp-parts > summary::after { content: "+"; margin-left: 8px; color: var(--muted); }
.cp-parts[open] > summary::after { content: "−"; }
.cp-parts[open] > summary { margin-bottom: 10px; }

/* ---------- wide screens: art left, Status right ---------- */
@media (min-width: 1024px) {
  .cp-hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
  .cp-stage { height: auto; min-height: 600px; }
  .cp-art { inset: 16px 16px 0; }
  .cp-plate { left: 22px; top: 18px; }
  .cp-forms { right: 14px; top: 14px; }
  .cp-modebox { left: 16px; bottom: 16px; }
  .cp-status { padding: 16px 18px 18px; }
  .sk-skills { height: 220px; }  /* Field + Buddy + a couple of Sync Skills in the narrow column: the usual height */
  .rc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .rc:not(:has(.ch-farm:not(:empty))) { grid-template-columns: minmax(0, 1fr); }
  .rc > .ch-farm { padding-left: 16px; border-left: 1px solid var(--line); }
  .rc > .ch-farm .farm-list { grid-template-columns: minmax(0, 1fr); }
}
/* phones */
@media (max-width: 600px) {
  .ch-bar .btn { padding: 9px 10px; }
  .ch-pos { font-size: 0.78rem; }
  .ch-wrap { padding-top: 10px; }
  .cp-stage { height: 340px; border-radius: 14px; }
  .cp-plate { left: 10px; top: 10px; max-width: 62%; }
  .cp-plate h1 { font-size: 1.5rem; }
  .cp-title { font-size: 0.72rem; padding: 3px 8px; }
  .cp-forms { right: 6px; top: 6px; max-width: 40%; }
  .cp-forms .form-switch { flex-direction: column; flex-wrap: nowrap; max-height: 270px; overflow-y: auto; scrollbar-width: none; }
  .cp-forms .fs-item { min-width: 54px; }
  .cp-forms .fs-item small { display: none; }
  .cp-modebox { left: 8px; bottom: 8px; }
  .cp-mode { min-height: 44px; font-size: 0.82rem; }
  .cp-mode-ico { width: 34px; height: 34px; }
  .cp-status { padding: 12px; border-radius: 14px; gap: 10px; }
  .cp-head { flex-wrap: wrap; min-height: 48px; }
  .cp-head .ch-rate-h { display: none; }
  .cp-id { grid-template-columns: 78px minmax(0, 1fr); gap: 10px; }
  .cp-medal { width: 78px; height: 90px; }
  .cp-medal img, .cp-medal .noicon, .sk-medal { width: 78px; height: 78px; }
  .cp-dl { min-height: 78px; }
  .cp-dl > div { grid-template-columns: 76px minmax(0, 1fr); gap: 6px; }
  .st-lb, .st-lv select { min-height: 44px; }
  .sk-ctl { height: 96px; }   /* 44 + 8 + 44 */
  .st-ctl { flex-wrap: nowrap; }
  .st-lv { flex: 1 1 auto; min-width: 0; }
  .st-lv > span { display: none; }
  .st-lv select { flex: 1; min-width: 0; max-width: none; }
  .st-card b { font-size: 1.45rem; }
  .ch-stat .st-facts { grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); }
  .ch-stat .st-facts .statbox { padding: 6px 8px; }
  .ch-stat .st-facts .statbox b { font-size: 0.95rem; }
  .ch-stat .st-facts .statbox small { white-space: normal; line-height: 1.2; }
  .cp-panel { border-radius: 14px; }
  .cp-ph { padding: 12px 12px 8px; }
  .cp-pb { padding: 0 12px 12px; }
  .jc-cells { grid-template-columns: 1fr 1fr; }
  .cp-body table.stat-table { font-size: 0.84rem; }
  .cp-body table.stat-table tbody th small { font-size: 0.7rem; }
  .rc-tile { width: 82px; }
  .farm { grid-template-columns: 96px minmax(0, 1fr); }
  .farm-art { width: 96px; }
}
@media (max-width: 380px) {
  .ch-pos { display: none; }
}

/* the free level slider under the level picker (stock stat curves only, scripts/unit_stats.py "curve") */
.st-slide { display: flex; align-items: center; gap: 10px; margin-top: 8px; min-height: 32px; color: var(--faint); font: 700 0.7rem var(--sans); }
.st-slide input { flex: 1; min-width: 0; height: 32px; margin: 0; accent-color: var(--orange-2); cursor: pointer; }
.st-slide input:focus-visible { outline: 2px solid var(--orange-2); outline-offset: 2px; }
@media (max-width: 600px) { .st-slide { min-height: 44px; } .st-slide input { height: 44px; } }
