/* Professions page. Uses only the tokens from app.css. */

.pf-head h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.pf-lede { margin: 4px 0 14px; color: var(--muted); font-size: 14px; }
.pf-loading { color: var(--muted); }
.dim { color: var(--muted); }
.small { font-size: 12.5px; }
.warn { color: var(--err); }
.ok { color: var(--r-green); }

/* profession picker */
.pf-tabs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px;
  margin-bottom: 20px;
}
.pf-tab {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px 7px 7px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); text-decoration: none; min-width: 0;
}
.pf-tab:hover { border-color: var(--muted); }
.pf-tab[aria-current="page"] { background: var(--raise); border-color: var(--gold); }
.pf-tab img { width: 30px; height: 30px; border-radius: 5px; flex: none; border: 1px solid var(--line); }
.pf-tab span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.pf-tab b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-tab small { color: var(--muted); font-size: 11.5px; }

/* title row */
.pf-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 12px; }
.pf-title h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.pf-title h2 small { color: var(--muted); font-weight: 400; font-size: 15px; }
.pf-meta { color: var(--muted); font-size: 13px; }
.pf-switch { margin-left: auto; display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.pf-switch button {
  border: 0; background: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 13.5px;
}
.pf-switch button[aria-selected="true"] { background: var(--raise); color: var(--text); }

.pf-how { color: var(--muted); font-size: 13px; max-width: 900px; margin: 0 0 14px; }
.pf-how summary { cursor: pointer; width: fit-content; }
.pf-how summary:hover { color: var(--text); }
.pf-how p { margin: 6px 0 0; line-height: 1.5; }
/* EverlookDB Crafting, at the end of the shopping list: one calm box, no fill, no button */
.pf-ingame { margin: 12px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.pf-shop .pf-ingame h4 { margin: 0 0 4px; font-size: 13px; color: var(--text); }
.pf-shop .pf-ingame p { margin: 0; }
.pf-ingame a { color: var(--field); }
.pf-ingame code { white-space: nowrap; font-size: 12px; }
.pf-route-sum { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.pf-route-sum b { color: var(--text); }
.pf-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 0 0 8px; }
.pf-controls .pf-range { margin: 0; }
.pf-controls .pf-toggle { margin: 0; min-height: 30px; }

/* guide: steps + shopping list */
.pf-guide { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.pf-steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pf-steps li {
  display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline;
  padding: 8px 6px; border-bottom: 1px solid var(--line);
}
.pf-step { cursor: pointer; }
.pf-step:hover, .pf-step.sel { background: var(--panel); }
.pf-step.sel { box-shadow: inset 2px 0 0 var(--gold); }
.pf-steps .rng { font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 600; font-size: 14px; white-space: nowrap; }
.pf-step .what { font-weight: 600; min-width: 0; }
.pf-step .mats { grid-column: 2 / 4; }
.pf-step .cost { grid-column: 3; grid-row: 1; text-align: right; font-size: 13px; }
.cnt { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.dots { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: 1px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.d-orange { background: var(--r-orange); } .d-yellow { background: var(--r-yellow); } .d-green { background: var(--r-green); }
.pf-train { background: var(--panel); font-size: 13.5px; }
.pf-train .rng::before { content: "▲ "; font-size: 10px; }
/* who trains the rank (trainers.js): one line per faction under the trainer step */
.pf-train > span:last-child { min-width: 0; }
.pf-trainers { margin-top: 4px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.pf-tr-h { color: var(--muted); margin-top: 4px; }
.pf-tr .cf-fac { min-width: 0; margin-right: 6px; font-weight: 600; }
.pf-npc { white-space: nowrap; }
.pf-tr-more { background: none; border: 0; padding: 0; color: var(--gold); cursor: pointer; font: inherit; }
.pf-tr-more:hover { text-decoration: underline; }
.pf-where h4 { margin: 10px 0 2px; font-size: 13px; }
.pf-stall { color: var(--err); font-size: 13.5px; }
/* how to learn a step's recipe (learn.js): one line under the step; optional hard recipes below it */
.pf-learn-line { grid-column: 2 / -1; color: var(--muted); font-weight: 400; min-width: 0; overflow-wrap: anywhere; }
.pf-learn-line .lv-k { color: var(--text); font-weight: 600; }
.pf-learn-line .cf-fac { min-width: 0; font-weight: 600; }
.pf-opt { cursor: pointer; font-size: 13px; background: transparent; }
.pf-opt .what { font-weight: 400; min-width: 0; }
.pf-opt:hover { background: var(--panel); }
.pf-side select { margin-left: 4px; }
.pf-learn .pf-tr-h { margin: 10px 0 2px; font-size: 13px; font-weight: 600; }
.pf-learn .dl li { display: flex; justify-content: space-between; gap: 8px; }
.pf-stall .rng { color: var(--err) !important; }

.chips { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.chip { white-space: nowrap; }
.chip .ic, .mat .ic { width: 16px; height: 16px; margin-right: 5px; vertical-align: -3px; }
.mat { white-space: nowrap; }

.pf-shop {
  position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px 10px;
}
.pf-shop h3 { margin: 0 0 2px; font-size: 16px; }
.pf-shop .pf-copy { margin: 2px 0 4px; font: inherit; font-size: 12.5px; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--line, #333); background: transparent; color: inherit; cursor: pointer; }
.pf-shop .pf-copy:hover { border-color: currentColor; }
.pf-shop h4 { margin: 14px 0 0; font-size: 13.5px; }
.pf-shop .small { margin: 4px 0; }
.pf-sum { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.pf-sum b { color: var(--text); }
.pf-shop ul, .drawer ul.dl { list-style: none; margin: 0 0 8px; padding: 0; }
.pf-shop li, .drawer ul.dl li {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.pf-shop li .mat, .drawer ul.dl li .mat { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pf-shop li .cost, .drawer ul.dl li .cost { flex: none; font-size: 12.5px; }

.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mg { color: var(--gold); } .ms { color: var(--muted); } .mc { color: var(--num); }

/* recipes table */
.pf-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.pf-filter input {
  height: 34px; width: min(320px, 100%); padding: 0 10px; border-radius: 7px;
  background: var(--panel); border: 1px solid var(--line); outline: none;
}
.pf-filter input:focus { border-color: var(--gold); }
.pf-table { overflow-x: auto; }
.pf-table td { max-width: none; }
.pf-table td.nm { font-weight: 600; }
.pf-table td.mt { white-space: normal; min-width: 260px; }
.pf-table tr.off td { opacity: .55; }
.pf-table tr.off:hover td { opacity: .85; }
.tag { font-size: 11px; font-weight: 400; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-left: 6px; }
.sk { display: inline-flex; gap: 8px; font-variant-numeric: tabular-nums; }
.sk span { min-width: 2.2em; text-align: right; }
.r-o { color: var(--r-orange); } .r-y { color: var(--r-yellow); } .r-g { color: var(--r-green); } .r-x { color: var(--r-gray); }

/* gathering notes */
.pf-note { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; max-width: 640px; }
.pf-note p { margin: 0 0 10px; font-size: 14px; }
.pf-note p.small { margin: 8px 0 0; }
.pf-mini th { position: static; background: none; cursor: default; }
.pf-mini td { white-space: normal; }

/* drawer extras */
.drawer h3.dh { font-size: 13px; color: var(--muted); font-weight: 600; margin: 16px 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.drawer .small { margin: 6px 0; }
.drawer sup { color: var(--muted); }

@media (max-width: 980px) {
  .pf-guide { grid-template-columns: 1fr; }
  .pf-shop { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .pf-tabs { display: flex; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)) 16px; padding: 0 var(--gutter) 4px; }
  .pf-tab { flex: none; }
  .pf-switch { margin-left: 0; }
  .pf-steps li { grid-template-columns: 62px minmax(0, 1fr); }
  .pf-step .mats { grid-column: 2; }
  .pf-step .cost { grid-column: 2; grid-row: auto; text-align: left; }
  .pf-learn-line { grid-column: 2; }
  .chip { white-space: normal; }
}

/* recipe items */
.pf-toggle { display: inline-flex; align-items: center; gap: 8px; margin: -6px 0 14px; font-size: 13.5px; cursor: pointer; user-select: none; }
.pf-toggle input { width: 16px; height: 16px; accent-color: var(--gold); margin: 0; }
.ic-rec { width: 16px; height: 16px; margin: 0 0 0 4px; vertical-align: -3px; }
.pf-table td.src { font-size: 13px; }

/* reagent sources: hard-to-get reagents are marked on recipe chips and grouped in the shopping list */
.kind { font-size: 11px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.chip.hard .kind { color: var(--r-orange); }
.chip.hard .cnt { color: var(--r-orange); }
.pf-shop h4 .dim { font-weight: 400; }
.pf-hint { font-size: 13px; margin: -6px 0 14px; padding: 6px 10px; border-left: 2px solid var(--r-orange); background: var(--panel); max-width: 900px; }

/* cooking and fishing guide */
.cf-total { font-size: 14px; margin: 0 0 18px; }
.cf-stage { margin: 0 0 26px; max-width: 1000px; }
.cf-stage h3 { margin: 0 0 10px; font-size: 17px; color: var(--gold); }
.cf-stage h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cf-stage h4 .tag { text-transform: none; letter-spacing: 0; }
.cf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px 20px; margin-bottom: 14px; }
.cf-grid > div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.cf-grid p { margin: 6px 0 0; }
.cf-zones, .cf-catch { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.cf-zones li, .cf-catch li { padding: 3px 0; }
.cf-fac { display: inline-block; min-width: 86px; font-size: 12px; color: var(--muted); }
.cf-a { color: var(--q-rare, #4f8fe6); } .cf-h { color: var(--err); } .cf-n { color: var(--r-yellow); }
.cf-steps li.cf-cook { grid-template-columns: 74px minmax(0, 1fr); }
.cf-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cf-body .what { font-weight: 600; }
.cf-body .what .small { font-weight: 400; margin-left: 6px; }
.cf-rec { white-space: nowrap; }
.cf-rec .ic { width: 16px; height: 16px; margin-right: 5px; vertical-align: -3px; }
.cf-buy { font-size: 13px; }
.cf-v { white-space: nowrap; }
.cf-steps .pf-train { grid-template-columns: 74px minmax(0, 1fr); }
@media (max-width: 640px) {
  .cf-steps li.cf-cook, .cf-steps .pf-train { grid-template-columns: 52px minmax(0, 1fr); }
  .cf-v { white-space: normal; }
}
.cf-link { margin: 0 0 14px; font-size: 14px; }
/* skill range picker (#tailoring/100-150) */
.pf-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 13.5px; }
.pf-range input { width: 68px; height: 30px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.pf-range button { height: 30px; padding: 0 12px; border-radius: 6px; border: 0; background: var(--gold); color: #1a1400; font-weight: 600; cursor: pointer; }
.pf-ahsum { font-size: 13px; margin: 10px 0 0; }

/* cheapest route: what to do with a step's crafts */
.pf-back { display: block; margin-top: 3px; color: var(--r-green); }
/* worth making at 300 */
.pf-worth { margin: 26px 0 0; max-width: 900px; }
.pf-worth h3 { margin: 0 0 2px; }
.pf-worth-list { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line); }
.pf-worth-row { display: grid; gap: 3px; padding: 8px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pf-worth-row:hover, .pf-worth-row.sel { background: var(--panel); }
.pf-worth-row .what { font-weight: 600; }
.pf-worth-row .what .dim { font-weight: 400; margin-left: 6px; }
.pf-worth details summary { cursor: pointer; padding: 8px 6px; color: var(--muted); font-size: 13.5px; }

/* recipe list: where it's learned, as filter chips (All · trainer · vendor pattern · …) */
.pf-srcs { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-src { background: var(--panel); color: var(--text); border: 1px solid var(--line, #2a3240); border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.pf-src:hover { border-color: var(--gold); }
.pf-src.on { border-color: var(--gold); color: var(--gold); }
.pf-src .dim { font-size: 12px; }
.pf-ghosts { color: var(--muted); }
.pf-filter .pf-ghosts { display: inline-flex; align-items: center; gap: 6px; flex-basis: 100%; cursor: pointer; }
.pf-filter .pf-ghosts input { width: auto; min-width: 0; height: auto; padding: 0; margin: 0; flex: none; accent-color: var(--gold); }
/* a tool to make or buy before the steps that need it (a Blacksmith Hammer, a Runed Copper Rod) */
.pf-tool .rng::before { content: "⚒ "; font-size: 11px; }
.pf-needs { white-space: nowrap; }

/* a profession's books (books.js): what each teaches and where to get it */
.bk { margin: 22px 0 10px; max-width: 1000px; }
.bk h3 { margin: 0 0 2px; font-size: 17px; }
.bk h4 { margin: 16px 0 6px; font-size: 14px; }
.bk > p { margin: 0 0 6px; }
.bk-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.bk-list li { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 2fr); gap: 2px 16px; padding: 7px 6px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.bk-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bk-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bk-body .lv-k { color: var(--text); font-weight: 600; }
.bk-in { margin: 0 0 6px; }
.bk-hit { box-shadow: inset 2px 0 0 var(--gold); background: var(--panel); }
@media (max-width: 640px) { .bk-list li { grid-template-columns: minmax(0, 1fr); } }
