/* Styles for the recipe lists, leveling guide, realms list, favorites, Discord bot page
   and other features added after the base layout (app.css). */

.gain { color: var(--up); }
.loss { color: var(--down); }
.pill { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 600; padding: 2px 7px; border-radius: 3px; background: var(--surface-3); color: var(--text); white-space: nowrap; }
.pill.tiny { font-size: .66rem; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }
.pill.sell-vh { background: color-mix(in oklab, var(--up) 18%, transparent); color: var(--up); }
.pill.sell-h { background: color-mix(in oklab, var(--up) 11%, transparent); color: color-mix(in oklab, var(--up) 80%, var(--text)); }
.pill.sell-m { background: color-mix(in oklab, var(--gold) 14%, transparent); color: var(--gold); }
.pill.sell-l, .pill.sell-vl { background: color-mix(in oklab, var(--down) 14%, transparent); color: var(--down); }
.pill.lbl-steady { background: color-mix(in oklab, var(--up) 18%, transparent); color: var(--up); }
.pill.lbl-recent { background: color-mix(in oklab, #2dd4bf 16%, transparent); color: #2dd4bf; }
.pill.lbl-volatile { background: color-mix(in oklab, var(--accent) 18%, transparent); color: var(--accent); }
.pill.lbl-losing { background: color-mix(in oklab, var(--down) 18%, transparent); color: var(--down); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--text); cursor: pointer; white-space: nowrap; }
.check input { accent-color: var(--primary); width: 15px; height: 15px; }
.link-btn.small { font-size: .82rem; padding: 2px 6px; }
.icon.ench { display: inline-block; width: 32px; height: 32px; background: linear-gradient(135deg, #6d28d9, #2563eb); }
.narrow { max-width: 860px; margin: 0 auto; }
.prose p { color: var(--text); line-height: 1.65; }

/* recipe rows */
.recipe-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.rc + .rc { border-top: 1px solid var(--line); }
.rc-head { display: grid; grid-template-columns: 32px 26px minmax(0, 1fr) auto 72px 72px 86px 28px; gap: 10px; align-items: center; padding: 9px 14px; }
.rc-head:hover { background: var(--surface-2); }
.rc-qty { color: var(--text-2); font-size: .86rem; }
.rc-name { min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rc-name a, .rc-name > span:first-child { font-weight: 600; }
.rc-skill { font-size: .74rem; color: var(--text-3); }
.rc-tags { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.rc-cell { display: grid; text-align: right; line-height: 1.25; }
.rc-cell span { font-size: .74rem; color: var(--text-2); }
.rc-cell strong { font-weight: 500; font-size: .88rem; white-space: nowrap; }
.rc-cell strong span { font-size: inherit; color: inherit; }
.rc-toggle { all: unset; cursor: pointer; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 4px; }
.rc-toggle:hover { background: var(--surface-3); }
.rc-toggle:focus-visible { outline: 2px solid var(--accent); }
.rc-toggle .chev { margin: 0 0 3px; transform: rotate(45deg); }
.rc-toggle[aria-expanded="true"] .chev { transform: rotate(-135deg); margin: 3px 0 0; }
.rc-body { padding: 4px 14px 14px 60px; background: color-mix(in oklab, var(--surface-2) 55%, var(--surface)); border-top: 1px solid var(--line); }
table.reagents td { border-bottom-color: color-mix(in oklab, var(--line) 70%, transparent); }
table.reagents tr.total td { border-bottom: 0; color: var(--text-2); }
.rc-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: .84rem; color: var(--text-2); margin-bottom: 6px; }
.prof-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.prof-cards > .card + .card { margin-top: 0; }
.prof-card-head { display: flex; gap: 12px; align-items: center; color: var(--text); }
.prof-card-head h2 { margin: 0 0 2px; }
a.link-card { color: var(--text); display: block; }
a.link-card:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }

/* browse: expandable price levels */
.exp-col { width: 34px; padding-right: 0; }
tr.levels-row > td { background: color-mix(in oklab, var(--surface-2) 55%, transparent); padding-top: 4px; padding-bottom: 10px; }
.levels table { width: auto; min-width: min(520px, 100%); }
.levels th, .levels td { padding: 4px 14px 4px 0; font-size: .86rem; border-bottom-color: color-mix(in oklab, var(--line) 70%, transparent); }

/* charts: overlay, band, zoom, legend */
.chart .line.overlay { stroke: var(--text); stroke-width: 1.6; stroke-dasharray: 5 4; opacity: .75; }
.chart .band { fill: var(--series-1); opacity: .16; }
.chart .zoom-sel { fill: var(--accent); opacity: .14; }
.chart-legend { display: flex; justify-content: center; gap: 16px; font-size: .78rem; color: var(--text-2); margin-bottom: 4px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 18px; height: 0; vertical-align: middle; margin-right: 6px; }
.chart-legend .lg-line { border-top: 2px solid var(--series-1); }
.chart-legend .lg-dash { border-top: 2px dashed var(--text); opacity: .75; }
.chart-legend .lg-band { height: 9px; background: var(--series-1); opacity: .3; border-radius: 2px; }
.seg button:disabled { opacity: .4; cursor: default; }

/* realms list */
.realm-list { padding: 0; }
.realm-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) 110px 90px 110px 110px; gap: 12px; align-items: center; padding: 11px 16px; color: var(--text); border-bottom: 1px solid var(--line); }
.realm-row:last-child { border-bottom: 0; }
.realm-row:hover { background: var(--surface-2); color: var(--text); }
.realm-name { display: grid; min-width: 0; }
.realm-name strong { color: var(--text-strong); font-weight: 600; }
.realm-faction { font-weight: 600; font-size: .9rem; }
.realm-faction.alliance { color: #6fa8ff; }
.realm-faction.horde { color: #ff6b6b; }
.realm-faction.merged, .realm-faction.neutral { color: var(--gold); }

/* favorites sparkline */
.spark { display: inline-block; min-width: 110px; }
.sparkline { display: block; margin-left: auto; overflow: visible; }
.sparkline path { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.sparkline .sp-up { stroke: var(--up); }
.sparkline .sp-down { stroke: var(--down); }
.sparkline .sp-up-dot { fill: var(--up); }
.sparkline .sp-down-dot { fill: var(--down); }

/* sidebar: recently viewed, previous realms */
.side-recent { display: flex; flex-direction: column; gap: 6px; }
.side-recent .side-label { margin: 4px 0 0; }
.side-list { display: flex; flex-direction: column; }
.side-list a { padding: 3px 10px; font-size: .88rem; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-list a:not([class*="q"]) { color: var(--text); }
.side-list a:hover { background: var(--surface-2); }

/* leveling */
.lvl-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .9rem; }
.lvl-inputs { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.lvl-in { display: grid; gap: 5px; font-size: .84rem; color: var(--text-2); }
.lvl-in input[type="number"] { width: 84px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; min-height: 32px; color: var(--text); }
.lvl-in select { min-width: 96px; }
.lvl-skill { display: flex; gap: 12px; align-items: center; }
.lvl-skill input[type="range"] { width: 170px; accent-color: var(--primary); }
.lvl-card .tabs { margin: 0; border-bottom: 1px solid var(--line); }
.tabs .tab { all: unset; cursor: pointer; padding: 10px 12px; color: var(--text-2); font-size: .95rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .tab:hover { color: var(--text-strong); }
.tabs .tab.active { color: var(--text-strong); font-weight: 600; border-bottom-color: var(--accent); }
.tabs .tab:focus-visible { outline: 2px solid var(--accent); }
.lvl-rank { display: flex; align-items: baseline; gap: 4px; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.lvl-rank strong { color: var(--text-strong); }
.lvl-rank-sum { margin-left: auto; display: flex; gap: 8px; align-items: baseline; }
.lvl-train { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text-strong); }
.lvl-step { display: grid; grid-template-columns: 20px 108px 30px minmax(0, 1fr) 28px 60px 96px; gap: 12px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.lvl-step input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.lvl-step.done { opacity: .5; }
.lvl-step.done .lvl-what a { text-decoration: line-through; }
.lvl-range { display: grid; gap: 5px; }
.lvl-range strong { color: var(--text-strong); font-variant-numeric: tabular-nums; }
.lvl-bar { display: flex; height: 3px; border-radius: 2px; overflow: hidden; background: var(--surface-3); }
.lvl-bar i { display: block; height: 100%; }
.sk-o { background: #f08a24; }
.sk-y { background: #e5c400; }
.sk-g { background: #3fb950; }
.lvl-what { min-width: 0; }
.lvl-what a, .lvl-what > span { font-weight: 600; }
.lvl-crafts { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.lvl-cost { text-align: right; }
.lvl-detail { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; padding: 8px 16px 12px 178px; border-bottom: 1px solid var(--line); background: color-mix(in oklab, var(--surface-2) 55%, var(--surface)); }
.lvl-reag { display: inline-flex; align-items: center; gap: 2px; font-size: .9rem; }
.lvl-card tfoot td { border-bottom: 0; }

/* discord bot page */
.bot-hero { padding: 28px 30px; }
.bot-hero h1 { font-size: 1.8rem; }
.bot-hero p { font-size: 1.05rem; max-width: 640px; }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.discord:hover { background: #4752c4; color: #fff; }
.steps3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.steps3 > .card + .card { margin-top: 0; }
.step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: .85rem; margin-bottom: 10px; }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.cmd-grid > .card + .card { margin-top: 0; }
.cmd code { color: var(--accent); font-size: .95rem; }
.cmd p { margin: 8px 0 4px; }

/* realm picker dialog */
/* sits near the top, centred over the content column (right of the 240 px sidebar) */
dialog.rp { position: fixed; top: 66px; margin: 0; left: calc(240px + (100vw - 240px - min(832px, 100vw - 240px - 32px)) / 2); width: min(832px, calc(100vw - 240px - 32px)); max-height: calc(100vh - 128px); padding: 0; overflow: hidden; display: flex; flex-direction: column; border-color: var(--line-strong); border-radius: 8px; }
dialog.rp:not([open]) { display: none; }
dialog.rp::backdrop { background: rgba(0, 0, 0, .72); }
@media (max-width: 900px) {
  dialog.rp { top: 64px; left: 50%; transform: translateX(-50%); width: calc(100vw - 24px); max-height: calc(100vh - 88px); }
}
.rp-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.rp-head h2 { margin: 0; font-size: 1.05rem; }
.rp-close { all: unset; cursor: pointer; font-size: 1.6rem; line-height: 1; color: var(--text-2); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 4px; }
.rp-close:hover { color: var(--text-strong); background: var(--surface-2); }
.rp-close:focus-visible { outline: 2px solid var(--accent); }
.rp-body { padding: 8px 20px 20px; overflow-y: auto; }
.rp-label { font-size: .84rem; color: var(--text-2); margin-bottom: 8px; }
.rp-recent { margin-bottom: 18px; }
.rp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rp-chip { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.rp-chip.on { border-color: var(--accent); }
.rp-chip button { all: unset; cursor: pointer; padding: 4px 6px 4px 12px; font-size: .9rem; color: var(--text); }
.rp-chip .rp-chip-x { padding: 4px 10px 4px 4px; color: var(--text-3); }
.rp-chip button:hover { color: var(--text-strong); }
.rp-chip button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rp-chip b, .rp-house b { font-weight: 700; }
.rp-region { color: var(--text-3); font-size: .78rem; }
b.alliance, .rp-house.alliance b { color: #6fa8ff; }
b.horde, .rp-house.horde b { color: #ff6b6b; }
b.neutral, .rp-house.neutral b { color: var(--gold); }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.rp-card { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 4px; align-content: start; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-height: 112px; }
.rp-card:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-strong); }
.rp-card.on { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 6%, var(--surface)); }
.rp-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.rp-game { font-size: 1.07rem; color: var(--text-strong); }
.rp-realm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.rp-realm-card { all: unset; box-sizing: border-box; cursor: pointer; display: grid; align-content: start; gap: 1px; min-height: 78px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
button.rp-realm-card:hover { background: var(--surface-2); border-color: var(--line-strong); }
.rp-realm-card:focus-visible { outline: 2px solid var(--accent); }
.rp-realm-card.on { border-color: var(--accent); }
.rp-realm-card.open { align-content: start; cursor: default; padding: 10px 8px; }
.rp-realm-card strong { color: var(--text-strong); font-size: 1rem; }
.rp-realm-card.open strong { padding: 0 2px 6px; }
.rp-mine { font-size: .84rem; font-weight: 600; margin-top: 4px; }
.rp-mine.alliance { color: #6fa8ff; }
.rp-mine.horde { color: #ff6b6b; }
.rp-factions { display: grid; gap: 6px; }
.rp-faction { all: unset; box-sizing: border-box; cursor: pointer; text-align: center; padding: 7px 8px; border-radius: 4px; font-weight: 600; font-size: .92rem; border: 1px solid transparent; }
.rp-faction.alliance { background: #1e3a66; color: #cfe0ff; }
.rp-faction.horde { background: #5a1f22; color: #ffd0d0; }
.rp-faction.neutral { background: transparent; color: var(--gold); }
.rp-faction:hover { filter: brightness(1.2); }
.rp-faction.on { border-color: #cfe0ff; }
.rp-faction:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
:root[data-theme="light"] .rp-faction.alliance { background: #dbe7fb; color: #1e4f9c; }
:root[data-theme="light"] .rp-faction.horde { background: #fbdcdc; color: #9b1c1c; }
:root[data-theme="light"] .rp-faction.on { border-color: var(--text); }
.rp-card:focus-visible { outline: 2px solid var(--accent); }
.rp-card:disabled { opacity: .55; cursor: default; }
.rp-card strong { font-size: 1.07rem; color: var(--text-strong); margin-bottom: 2px; }
.rp-card span { font-size: .88rem; color: var(--text); }
.rp-sub { font-size: .8rem !important; color: var(--text-2) !important; }
.rp-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.rp-search { flex: 1; min-width: 180px; }
.rp-realms { display: grid; gap: 8px; }
.rp-realm { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rp-realm-name { display: grid; min-width: 0; }
.rp-realm-name strong { color: var(--text-strong); }
.rp-houses { display: flex; gap: 8px; flex-wrap: wrap; }
.rp-house { all: unset; box-sizing: border-box; cursor: pointer; display: grid; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface-2); min-width: 120px; }
.rp-house span { font-size: .76rem; color: var(--text-2); }
.rp-house:hover { background: var(--surface-3); }
.rp-house.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.rp-house:focus-visible { outline: 2px solid var(--accent); }

@media (max-width: 900px) {
  .rc-head { grid-template-columns: 32px minmax(0, 1fr) 80px 28px; }
  .rc-qty, .rc-tags, .rc-head > .rc-cell:not(.rc-profit) { display: none; }
  .rc-body { padding-left: 14px; }
  .realm-row { grid-template-columns: 70px minmax(0, 1fr) 90px; }
  .realm-row > .num { display: none; }
  .realm-row > .num:nth-child(5) { display: block; }
  .lvl-step { grid-template-columns: 20px 86px minmax(0, 1fr) 28px 70px; }
  .lvl-step > .icon, .lvl-step > .lvl-crafts { display: none; }
  .lvl-detail { padding-left: 16px; }
}
dialog.rp:focus { outline: none; }
.rp-nav .link-btn { color: var(--text-2); padding-left: 2px; }
.rp-nav .link-btn:hover { color: var(--text-strong); background: none; }
.rp-game { font-size: 1.12rem; }
.rp-mine.horde { color: #f28b8b; }

/* account */
.side-account { margin-bottom: 6px; }
.side-account .btn.discord { gap: 8px; font-size: .9rem; }
.btn.discord svg { width: 18px; height: 18px; }
.acct { gap: 8px !important; }
.acct-tag { margin-left: auto; font-size: .76rem; color: var(--text-3); }
.avatar { width: 22px; height: 22px; border-radius: 50%; flex: none; object-fit: cover; }
.avatar.ph { display: inline-grid; place-items: center; background: #5865f2; color: #fff; font-size: .72rem; font-weight: 700; }
.avatar.big { width: 48px; height: 48px; font-size: 1.2rem; }
.acct-card { display: flex; align-items: center; gap: 14px; }
.acct-card strong { color: var(--text-strong); font-size: 1.05rem; }
.empty h1, .empty h2, .card.empty h2 { justify-content: center; text-align: center; }
a.title-link, a.title-link:hover { color: inherit; text-decoration: none; }
a.tt { display: inline-flex; }
/* account page: centred vertically in the window */
.center-page { min-height: calc(100vh - 92px); display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 900px) { .center-page { min-height: calc(100vh - 140px); } }
.narrow.center-page { max-width: 560px; }
.center-page > .btn { align-self: flex-start; }
