/* The look of the server version's client (src/MHWildsOptimizer.Web/client/src/styles.css), adapted for MudBlazor:
   the UI zoom applies to .app (popovers render outside it), and MudBlazor's controls get the same colours below. */
:root {
  --bg: #121419;
  --bg-2: #181b22;
  --panel: #1e222b;
  --panel-2: #252a35;
  --border: #2f3542;
  --border-2: #3b4254;
  --text: #e8e6e1;
  --muted: #9aa1ad;
  --accent: #e3b64e;
  --accent-2: #4fa3e6;
  --ok: #5fbf7a;
  --warn: #e8b04b;
  --err: #e05a4f;
  --weapon: #4fc3f7;
  --armor: #7fd1c4;
  --set: #e3b64e;
  --group: #c08cf2;
  --radius: 8px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
  /*
    Baseline size: the whole page is drawn at 150% with a mouse (desktop), 100% on touch screens (phones, tablets).
    Browser zoom (Ctrl +/-) works on top of it. Fixed-position popovers and 100vh divide by --ui-zoom, and the
    breakpoints below are in window px: with a mouse they are the layout widths x 1.5 (the sidebar
    collapses a little earlier, below 1450 px, where the weapon preview no longer fits next to it).
  */
  --ui-zoom: 1;
}
@media (pointer: fine) { :root { --ui-zoom: 1.35; } }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0.4em 0; }
img.icon { vertical-align: middle; image-rendering: auto; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.right { margin-left: auto; text-align: right; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.err { color: var(--err); }
.with-icon { display: inline-flex; align-items: center; gap: 4px; }
.linklike { background: none; border: none; padding: 0; color: var(--accent-2); cursor: pointer; text-decoration: underline dotted; }
.linklike.err { color: var(--err); }
.linklike.warn { color: var(--warn); }
.total { color: var(--ok); }
code { background: var(--panel-2); padding: 0.1em 0.3em; border-radius: 4px; }

/* ---------------------------------------------------------------- layout */
.boot { padding: 4em; text-align: center; color: var(--muted); }
.boot-error { color: var(--text); max-width: 40em; margin: 0 auto; text-align: left; }
/* index.html's start screen: a short description under the loading line */
.boot-intro { max-width: 40em; margin: 0 auto; padding: 4em 16px; text-align: left; }
.boot-intro h1 { color: var(--accent); font-size: 32px; font-weight: 800; }
.boot-intro .boot-tag { color: var(--text); font-size: 16px; margin-bottom: 1.5em; }
.boot-intro .boot-loading { color: var(--text); margin-bottom: 1.5em; }
.boot-intro ul { padding-left: 1.2em; }
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 60px 1fr 32px;
  grid-template-areas: "top top" "nav main" "status status";
  zoom: var(--ui-zoom);
  /* the page is scaled with zoom on <html> (uiScale.ts), which scales vh too */
  height: calc(100vh / var(--ui-zoom, 1));
}
.topbar { grid-area: top; display: flex; align-items: center; gap: 24px; padding: 0 16px; background: var(--bg-2); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand img { width: 40px; height: 40px; }
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: 0.02em; }
.brand-sub { font-size: 12px; color: var(--muted); }
.sidenav { grid-area: nav; display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; background: var(--bg-2); border-right: 1px solid var(--border); overflow-y: auto; }
.navgroup { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 10px 10px 2px; }
.navgroup:first-child { padding-top: 2px; }
.navitem { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: none; border-radius: var(--radius); background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.navitem:hover { background: var(--panel); }
.navitem.active { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.navitem img { width: 24px; height: 24px; }
.navlabel { flex: 1; }
.navbadge { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--border); color: var(--muted); }
.navbadge.ok { background: rgba(95, 191, 122, 0.18); color: var(--ok); }
.navbadge.warn { background: rgba(232, 176, 75, 0.18); color: var(--warn); }
.navbadge.err { background: rgba(224, 90, 79, 0.2); color: var(--err); }
.navbadge.acc { background: rgba(227, 182, 78, 0.18); color: var(--accent); }
.content { grid-area: main; overflow-y: auto; padding: 18px 22px 40px; }
.statusbar { grid-area: status; display: flex; align-items: center; gap: 16px; padding: 0 16px; font-size: 12px; background: var(--bg-2); border-top: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.statusbar .right { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.statusbar > :first-child { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.statusbar .statuslink { text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statusbar .statuslink:hover { text-decoration: underline; }
.toast { position: fixed; bottom: 48px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--border-2); padding: 10px 16px; border-radius: var(--radius); box-shadow: var(--shadow); z-index: 10; }
.toast.error { border-color: var(--err); }

@media (max-width: 900px), (pointer: fine) and (max-width: 1450px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr 32px; grid-template-areas: "top" "nav" "main" "status"; height: auto; min-height: calc(100vh / var(--ui-zoom, 1)); }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 10px; }
  .sidenav { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 6px 8px; }
  .navitem { padding: 6px 10px; white-space: nowrap; }
  .navlabel { display: none; }
  .navgroup { display: none; }
  .content { padding: 12px; }
  .two-col { grid-template-columns: 1fr !important; }
  .two-col .col.sticky-side { position: static; }
  .configdivider { display: none; }
  .statusbar .right { display: none; }
  /* narrow screens: header actions go below the title and wrap */
  .card-head { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "toggle title" ". hint" ". actions"; }
  .card-head:not(.collapsible) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "hint" "actions"; }
  .card-actions { margin-top: 8px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .card-body { overflow-x: auto; }
  .card-actions .btn-row { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------- config bar */
.configbar { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.configpick { display: flex; align-items: center; gap: 6px; }
.configpick select { background: var(--panel); border: 1px solid var(--border-2); border-radius: 6px; padding: 6px 8px; max-width: 220px; }
.configname.dirty { font-size: 11.5px; padding: 2px 8px; border-radius: 10px; color: var(--warn); border: 1px solid rgba(232, 176, 75, 0.5); white-space: nowrap; }
.configactions { gap: 4px; align-items: center; }
/* profile on one side, the open weapon on the other */
.configdivider { width: 1px; align-self: stretch; margin: 8px 4px; background: var(--border-2); }
.weaponpick { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.weaponpick img { flex: 0 0 auto; }
.weaponpick-new { width: 20px; text-align: center; font-weight: 700; color: var(--accent); }
.configrun { margin-left: 8px; }
.saveas { display: flex; align-items: center; gap: 4px; }
.saveas input { background: var(--panel); border: 1px solid var(--border-2); border-radius: 6px; padding: 5px 8px; width: 160px; }

/* ---------------------------------------------------------------- cards and forms */
.panel { display: flex; flex-direction: column; gap: 16px; max-width: 1400px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.two-col .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* the side card stays in view while the long left column scrolls */
.two-col .col.sticky-side { position: sticky; top: 0; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
/* the first row (toggle, title, header actions) is centered, so a title sits level with taller buttons; the hint goes below the title */
.card-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "toggle title actions" ". hint .";
  align-items: center; column-gap: 8px; padding: 12px 18px 10px 8px; border-bottom: 1px solid var(--border);
}
.card-head:not(.collapsible) { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title actions" "hint ."; padding-left: 18px; }
.card-title { display: contents; }
.card-head h2 { grid-area: title; font-size: 15px; }
.card-head .hint { grid-area: hint; color: var(--muted); font-size: 12.5px; margin: 2px 0 0; }
.card-head.collapsible h2, .card-head.collapsible .hint { cursor: pointer; }
.card-toggle {
  grid-area: toggle; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid transparent; border-radius: 6px; background: none; color: var(--text); opacity: 0.8; cursor: pointer;
}
.card-toggle svg { transition: transform 0.12s; }
.card:not(.collapsed) .card-toggle svg { transform: rotate(90deg); }
.card-toggle:hover, .card-toggle:focus-visible { opacity: 1; background: var(--panel-2); border-color: var(--border-2); }
.card.collapsed .card-head { border-bottom: none; padding-bottom: 12px; }
.card.collapsed .card-head h2 { color: var(--muted); }
.card-actions { grid-area: actions; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.inline { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
.field.inline .field-label { white-space: nowrap; }
.field-label { font-weight: 600; font-size: 13px; }
.field-hint { color: var(--muted); font-size: 12px; }
.btn-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hint { margin: 0; }

.btn { background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); border-radius: 6px; padding: 7px 14px; cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1507; font-weight: 600; }
.btn.danger { background: rgba(224, 90, 79, 0.15); border-color: var(--err); color: var(--err); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.iconbtn { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 6px; }
.iconbtn:hover { color: var(--err); }

.number, .text, .select, .search { background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 6px; padding: 7px 10px; min-width: 0; }
.number { width: 110px; }
.select { max-width: 100%; }
.search { width: 100%; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-2); border-radius: 6px; overflow: hidden; background: var(--bg-2); }
.stepper button { width: 30px; height: 30px; border: none; background: transparent; cursor: pointer; font-size: 16px; }
.stepper button:disabled { opacity: 0.3; cursor: default; }
.stepper button:hover:not(:disabled) { background: var(--panel-2); }
.stepper-value { min-width: 32px; text-align: center; font-weight: 600; }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border-2); border-radius: 6px; overflow: hidden; background: var(--bg-2); }
.segmented button { border: none; background: transparent; padding: 7px 12px; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; border-right: 1px solid var(--border); }
.segmented button:last-child { border-right: none; }
.segmented button small { color: var(--muted); font-size: 11px; }
.segmented button > span:has(> small) { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; }
.segmented.small button > span:has(> small) { flex-direction: row; gap: 5px; align-items: baseline; }
.segmented button.active { background: var(--panel-2); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.segmented button.active small { color: var(--text); }
.segmented button:disabled { opacity: 0.4; cursor: not-allowed; }
.segmented.small button { padding: 4px 10px; font-size: 12.5px; flex-direction: row; gap: 4px; }

.toggle { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track { flex-shrink: 0; width: 36px; height: 20px; border-radius: 10px; background: var(--border-2); position: relative; transition: background 0.15s; margin-top: 2px; }
.toggle-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: left 0.15s; }
.toggle.on .toggle-track { background: var(--accent); }
.toggle.on .toggle-thumb { left: 18px; background: #1a1507; }
.toggle.disabled { opacity: 0.5; cursor: not-allowed; }
.toggle-text { display: flex; flex-direction: column; gap: 2px; }

.alert { padding: 8px 12px; border-radius: 6px; border: 1px solid; font-size: 13px; }
.alert.error { border-color: var(--err); background: rgba(224, 90, 79, 0.1); }
.alert.warning { border-color: var(--warn); background: rgba(232, 176, 75, 0.1); }
.alert.info { border-color: var(--accent-2); background: rgba(79, 163, 230, 0.1); }
.alert.ok { border-color: var(--ok); background: rgba(95, 191, 122, 0.1); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .num { text-align: right; }
ul.plain { margin: 4px 0; padding-left: 18px; columns: 2; }
ul.plain li { break-inside: avoid; }

/* ---------------------------------------------------------------- chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 4px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); font-size: 12.5px; line-height: 1.6; white-space: nowrap; }
.chip b { font-weight: 700; }
.chip .of { color: var(--muted); font-weight: 400; }
.chip .valued { color: var(--warn); font-size: 11px; }
.chip.skill.weapon { border-color: rgba(79, 195, 247, 0.5); }
.chip.skill.weapon b { color: var(--weapon); }
.chip.skill.armor b { color: var(--armor); }
.chip.skill.set { border-color: rgba(227, 182, 78, 0.5); color: var(--set); }
.chip.skill.group { border-color: rgba(192, 140, 242, 0.5); color: var(--group); }
.chip.muted { opacity: 0.6; }
.chip.tiny { font-size: 11px; padding: 0 6px 0 3px; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--accent); }
.chip.pick { padding: 5px 12px 5px 8px; cursor: pointer; }
.chip.pick img { width: 18px; height: 18px; }
.chip.pick.active { border-color: var(--tint, var(--accent)); box-shadow: inset 0 0 0 1px var(--tint, var(--accent)); color: var(--tint, var(--accent)); }
.chip.deco { padding-right: 10px; }
.skilltip { position: fixed; z-index: 20; width: 320px; padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--border-2); border-left: 3px solid var(--armor); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); font-size: 12.5px; line-height: 1.45; white-space: normal; pointer-events: none; }
.skilltip.weapon { border-left-color: var(--weapon); }
.skilltip.set { border-left-color: var(--set); }
.skilltip.group { border-left-color: var(--group); }
.skilltip-head { display: flex; align-items: center; gap: 6px; }
.skilltip p { margin: 6px 0 0; }
.skilltip ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.skilltip .current { color: var(--accent); }
.skilltip .current .muted { color: inherit; }
.kindtag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 5px; border-radius: 4px; background: var(--border); color: var(--muted); }
.kindtag.weapon { color: var(--weapon); }
.kindtag.armor { color: var(--armor); }
.kindtag.set { color: var(--set); }
.kindtag.group { color: var(--group); }
.rarity { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--border); }
.rarity.r5 { color: #5fbf7a; }
.rarity.r6 { color: #4fa3e6; }
.rarity.r7 { color: #b07be8; }
.rarity.r8 { color: #ff8c42; }
.slots { display: inline-flex; gap: 3px; }
.slot { position: relative; display: inline-flex; align-items: center; justify-content: flex-end; width: 24px; height: 18px; padding-right: 4px; border-radius: 4px; background: var(--border-2); font-size: 11px; font-weight: 700; color: var(--armor); }
/* the helmet (armor) or sword (weapon) mark in the top-left corner of a slot square */
.slot-kind { position: absolute; left: 1px; top: 1px; height: 10px; width: auto; pointer-events: none; }
.talisman-slots { display: flex; flex-direction: column; gap: 6px; }
.talisman-slot-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.talisman-slot-row > .muted { width: 12px; text-align: right; }
.kind-choice { display: inline-flex; align-items: center; gap: 5px; }
.kind-choice img { height: 14px; width: auto; }
.slot.weapon { color: var(--weapon); }
.deco-empty { display: inline-flex; align-items: center; justify-content: center; border: 1px dashed var(--border-2); border-radius: 50%; color: var(--muted); font-size: 11px; }
.sharp-dot::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--c, #888); }
.sharp-dot.sharp-red { --c: #d9342b; } .sharp-dot.sharp-orange { --c: #e8862a; } .sharp-dot.sharp-yellow { --c: #e6d22d; } .sharp-dot.sharp-green { --c: #55c43a; }
.sharp-dot.sharp-blue { --c: #3c8df0; } .sharp-dot.sharp-white { --c: #f2f2f2; } .sharp-dot.sharp-purple { --c: #b56bf5; }
.sharpbar-wrap { display: inline-flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.sharpbar { display: flex; width: 220px; max-width: 100%; height: 10px; border-radius: 3px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--border-2); }
.sharpbar .seg { height: 100%; }

/* ---------------------------------------------------------------- weapon */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.type-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; color: var(--text); }
.type-card img { width: 40px; height: 40px; }
.type-card small { color: var(--muted); font-size: 10.5px; text-align: center; }
.type-card:hover:not(:disabled) { border-color: var(--accent-2); }
.type-card.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.type-card:disabled { opacity: 0.4; cursor: not-allowed; }
.reinforcements { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
/* a saved weapon's type, with the grid behind Change type */
.type-chosen { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* a weapon part the optimizer can choose: the switch on the label line, the value greyed while it chooses */
.optfield-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.optfield-switch { display: inline-flex; align-items: center; font-size: 12.5px; color: var(--muted); }
.optfield-switch .mud-switch { margin: 0; }
.optfield-switch .mud-typography { font-size: 12.5px; }
.optfield.optimized .optfield-body, .optfield-body[inert] { opacity: 0.4; }
.optfield-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text); padding: 6px 10px; border-left: 2px solid var(--accent-2); background: rgba(79, 163, 230, 0.06); border-radius: 4px; }
/* reinforcement lines as counts per type and tier */
.rf-grid { display: grid; grid-template-columns: minmax(80px, auto) repeat(4, auto); gap: 4px 10px; align-items: center; justify-content: start; }
.rf-tier { font-size: 11.5px; color: var(--muted); text-align: center; }
.rf-type { font-size: 13px; }
.rf-none { text-align: center; }
.rf-cell .stepper-value { min-width: 26px; text-align: center; }
.rf-cell:not(.on) .stepper-value { color: var(--muted); }
.rf-cell.on .stepper-value { color: var(--accent); font-weight: 700; }
.rf-total { margin: 6px 0 0; }
.storage-bar { margin: 4px 0 10px; }
/* whose settings a tab shows (the open weapon's, the profile's) */
.scope-note { margin: 0 0 12px; padding: 8px 12px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--border); color: var(--muted); }
.scope-note b { color: var(--text); }
.weapon-preview { display: flex; flex-direction: column; gap: 12px; }
.weapon-head { display: flex; align-items: center; gap: 12px; }
.weapon-head img { width: 48px; height: 48px; }
.weapon-head .big { font-size: 17px; font-weight: 700; }
dl.stats { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; align-items: center; }
dl.stats dt { color: var(--muted); display: flex; align-items: center; gap: 6px; }
dl.stats dt img { width: 18px; height: 18px; }
dl.stats dd { margin: 0; }
.baseline { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.baseline .total { font-size: 16px; }

/* ---------------------------------------------------------------- skill pair */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; color: var(--text); }
.choice h3 { font-size: 15px; margin-bottom: 4px; }
.choice.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice .pair { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.choice p { margin: 0.2em 0; }

/* ---------------------------------------------------------------- skill picker */
.skillpicker { display: flex; flex-direction: column; gap: 12px; }
.selected { display: flex; flex-direction: column; gap: 6px; }
.skillrow { display: flex; align-items: center; gap: 12px; padding: 8px 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); border-left-width: 3px; }
.skillrow.weapon { border-left-color: var(--weapon); }
.skillrow.armor { border-left-color: var(--armor); }
.skillrow.set { border-left-color: var(--set); }
.skillrow.group { border-left-color: var(--group); }
.skillrow { flex-wrap: wrap; }
.skillrow-main { flex: 1 1 220px; min-width: 0; } /* on phones the level controls go below the text */
.skillrow-actions { margin-left: auto; }
.skillrow-title { display: flex; align-items: center; gap: 8px; }
.skillrow-actions { display: flex; align-items: center; gap: 8px; }
.picker-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.picker-tools .search { flex: 1; min-width: 200px; width: auto; }
.available { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); }
.skillopt-row { display: flex; border-bottom: 1px solid var(--border); }
.skillopt-row:last-child { border-bottom: none; }
.skillopt-row:hover { background: var(--panel-2); }
.skillopt { flex: 1; min-width: 0; display: grid; grid-template-columns: 26px minmax(150px, 190px) auto 1fr; align-items: center; gap: 10px; padding: 6px 10px; border: none; background: transparent; color: var(--text); text-align: left; }
/* a button per level: the skill is required at the level clicked */
.skillopt-levels { flex: none; display: flex; align-items: center; gap: 3px; padding: 0 8px; }
.skillopt-levels .lvl { min-width: 26px; padding: 2px 7px; border: 1px solid var(--border-2); border-radius: 4px; background: var(--bg-2); color: var(--text); font-size: 12px; cursor: pointer; white-space: nowrap; }
.skillopt-levels .lvl:hover, .skillopt-levels .lvl:focus-visible { border-color: var(--accent); color: var(--accent); }
.available-divider { padding: 6px 10px; background: var(--bg-2); border-bottom: 1px solid var(--border); }
.preset-source { color: var(--accent); }
.skillopt-exclude { flex: none; width: 40px; border: none; border-left: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; }
.skillopt-exclude:hover { color: var(--err); background: rgba(224, 90, 79, 0.12); }
/* a target / limit row: at least, at most, exclude */
.skillrow .rule { display: inline-flex; align-items: center; gap: 6px; }
.skillrow .rule .stepper-value { min-width: 64px; }
.skillrow .rule > span, .skillrow .rule .stepper-value { white-space: nowrap; }
.skillrow-actions { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 700px) { .skillrow .rule .stepper-value { min-width: 48px; } .skillrow .exclude { padding: 0 8px; } }
.skillrow .exclude { height: 32px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.skillrow .exclude:hover, .skillrow .exclude.on { color: var(--err); border-color: var(--err); }
.skillrow .exclude.on { background: rgba(224, 90, 79, 0.12); }
.skillrow.excluded { border-left-color: var(--err); }
.skillrow.excluded .skillrow-title b { text-decoration: line-through; opacity: 0.75; }
.skillopt .name { font-weight: 600; }
.skillopt .desc { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.skillopt.hl .name::after { content: " ★"; color: var(--accent); }
@media (max-width: 700px), (pointer: fine) and (max-width: 1050px) {
  .skillopt { grid-template-columns: 26px 1fr; } .skillopt .desc, .skillopt .muted, .skillopt .kindtag { display: none; }
  .skillopt-levels { padding: 0 4px; gap: 2px; } .skillopt-levels .lvl { min-width: 24px; padding: 2px 5px; }
}

/* ---------------------------------------------------------------- conditions */
.cond-group h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 6px 0 8px; }
.cond-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 8px; }
.cond { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.cond.on { border-color: rgba(227, 182, 78, 0.5); }
.cond input { margin-top: 3px; accent-color: var(--accent); }
.cond-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cond-skills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.cond-skills .chip { white-space: normal; } /* long set bonus lists wrap instead of widening the page */
.cond.resonance { cursor: default; }
.cond-uptime { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 6px; cursor: default; }
.cond-uptime .segmented.small button { padding: 4px 8px; }

/* ---------------------------------------------------------------- talismans / options */
.talisman-table td.right { white-space: nowrap; }
.setlist { display: flex; flex-direction: column; max-height: 520px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); }
.setrow { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.setrow:last-child { border-bottom: none; }
.setrow:hover { background: var(--panel-2); }
.setrow.excluded { opacity: 0.55; text-decoration: line-through; }
.setrow input { accent-color: var(--err); }
.setrow.allow input { accent-color: var(--ok); }
.allow-from { margin-bottom: 10px; }
.allow-kinds { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.allow-kind { display: flex; align-items: center; gap: 10px; }
.allow-kind-name { width: 48px; flex: none; }
.allow-kind .chip .linklike { padding: 0 2px; line-height: 1; }
.allow-none { padding: 6px 10px; margin: 0; }
.setmain { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.setname { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.setinfo { display: flex; flex-wrap: wrap; gap: 4px 10px; }

/* ---------------------------------------------------------------- review */
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.kv { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kv h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.kv h4 .linklike { color: var(--muted); text-decoration: none; text-transform: inherit; letter-spacing: inherit; font: inherit; }
.kv h4 .linklike:hover { color: var(--accent-2); }

/* ---------------------------------------------------------------- results */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px; }
.progress { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.progress b { color: var(--text); font-weight: 600; }
.progress-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.progress-last { font-family: ui-monospace, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.runlog { max-height: 260px; overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px; font: 12px/1.5 ui-monospace, Consolas, monospace; color: var(--muted); margin: 6px 0 0; white-space: pre-wrap; }
.table.pairs tbody tr { cursor: pointer; }
.table.pairs tbody tr:hover td { background: var(--panel-2); }
.pair-block { display: flex; flex-direction: column; gap: 12px; }
.pairhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 4px 0; border-top: 2px solid var(--accent); }
.pairhead .rank { font-weight: 800; color: var(--accent); font-size: 16px; cursor: help; }
.pairhead-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.build { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.build.best { border-color: var(--ok); }
.build-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.build-rank { font-weight: 700; padding: 3px 10px; border-radius: 6px; background: var(--border); }
.build.best .build-rank { background: var(--ok); color: #0d1a10; }
.score { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.score .efr, .score .efe { font-weight: 600; }
.score .total { font-size: 22px; font-weight: 800; color: var(--ok); }
.score .plus, .score .eq { color: var(--muted); }
.score .procs { font-weight: 600; color: var(--accent); }
.dmg-toggle { display: inline-flex; align-items: baseline; gap: 8px; padding: 0; border: none; background: none; color: inherit; text-align: left; cursor: pointer; }
.dmg-toggle:hover .muted { color: var(--text); }
.dmg-toggle .caret { font-size: 11px; }
.dmg-breakdown { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px 10px; }
.dmg-breakdown p { margin: 6px 0 0; }
.dmg-scroll { overflow-x: auto; }
.table.dmg { font-size: 13px; }
.table.dmg th, .table.dmg td { padding: 4px 8px; }
.table.dmg td { border-bottom: none; }
.table.dmg .num { width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table.dmg .avg { font-weight: 700; color: var(--ok); }
.table.dmg th.vs { white-space: normal; min-width: 70px; }
.dmg-attack td { border-top: 1px solid var(--border); }
.dmg-name { display: inline-flex; align-items: baseline; gap: 0 6px; flex-wrap: wrap; }
.table.dmg .dmg-hit td { padding-top: 1px; padding-bottom: 1px; font-size: 12px; color: var(--muted); }
.table.dmg .dmg-hit td:first-child { padding-left: 34px; }
.table.dmg tfoot td { font-weight: 700; border-top: 1px solid var(--border-2); border-bottom: none; }
/* narrow screens: the step or hit name on its own line above its numbers */
@media (max-width: 600px), (pointer: fine) and (max-width: 900px) {
  .dmg-breakdown { padding: 4px 8px 8px; }
  .table.dmg tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .table.dmg tr > :first-child { grid-column: 1 / -1; }
  .table.dmg.with-delta tr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .table.dmg th, .table.dmg td { padding-left: 4px; padding-right: 4px; }
  .table.dmg th.vs { min-width: 0; }
  .table.dmg thead th:first-child { display: none; }
  .table.dmg .num { width: auto; }
  .table.dmg .dmg-attack, .table.dmg tfoot tr { border-top: 1px solid var(--border); }
  .table.dmg .dmg-attack td, .table.dmg tfoot td { border-top: none; }
  .table.dmg .dmg-hit td:first-child { padding-left: 20px; }
}
.optnum { display: inline-flex; align-items: center; gap: 6px; }
.form-grid.profile { margin-top: 12px; }
.form-grid.profile.off { opacity: 0.55; }
.attack-target { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px 28px; margin-bottom: 12px; }
.attack-target h3 { margin-bottom: 8px; }
.attack-col, .target-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.target-pickers { display: flex; flex-wrap: wrap; gap: 8px; }
.target-pickers .selectbox { flex: 1 1 200px; min-width: 0; }
.target-line b { color: var(--text); }
.table.hits td, .table.hits th { padding: 4px 8px; }
.attack-summary { margin: 0 0 10px; color: var(--muted); }
.sequence { display: flex; flex-direction: column; gap: 8px; }
.sequence-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sequence-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sequence-step { background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
.step-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-no { font-weight: 700; color: var(--muted); min-width: 18px; }
.step-row .step-attack { flex: 1 1 220px; min-width: 0; }
.step-repeat { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.step-actions { display: inline-flex; gap: 2px; margin-left: auto; }
.step-conds { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-left: 26px; }
.step-conds .step-cond-picker { flex: 0 1 260px; min-width: 0; }
.chip.step-cond { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.chip.step-cond.off { border-color: var(--warn, #c9a227); }
.attack-summary b { color: var(--text); }
.statchips { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.statchip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border); font-size: 12.5px; }
.statchip img { width: 16px; height: 16px; }
.statchip small { color: var(--muted); }
.statchip.atk b { color: #f26b5c; }
.statchip.aff b { color: var(--accent); }
.statchip.crit b { color: #ffa14f; }
.statchip.sharp, .statchip.ele { border-color: var(--tint); color: var(--tint); }
.build-body { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.build-row { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.build-row .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; min-width: 54px; padding-top: 4px; }
.why { font-size: 12.5px; margin: 0; }
.table.equip td { padding: 8px 8px; }
.table.equip .icon-cell { width: 40px; }
.table.equip .piece { width: 70px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.table.equip .name { min-width: 180px; }
.table.equip .name .small { display: flex; gap: 10px; flex-wrap: wrap; }
.table.equip .decos { width: 270px; }
.slotdecos { display: inline-flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.slotdeco-row { display: inline-flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.slotdeco { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; width: 72px; text-align: center; }
.slotdeco .deco-empty + .tiny { opacity: 0.6; }
.slotdeco .tiny { line-height: 1.2; }
.details { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.details h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.details-toggle { align-self: flex-start; }
.pc { display: inline-block; margin-right: 12px; color: var(--muted); }
.pc.active { color: var(--text); font-weight: 600; }
.stats-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.statsblock { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.statsblock dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0; font-size: 13px; }
.statsblock dt { color: var(--muted); }
.statsblock dd { margin: 0; }
.mods { margin: 0; padding-left: 18px; font-size: 12px; color: var(--muted); columns: 2; }
.rawtext { font: 11.5px/1.45 ui-monospace, Consolas, monospace; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px; overflow: auto; max-height: 500px; }
details summary { cursor: pointer; color: var(--accent-2); }

/* ---------------------------------------------------------------- picker (searchable dropdown) */
.picker-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 6px; padding: 5px 10px; cursor: pointer; text-align: left; color: var(--text); }
.picker-btn:hover, .picker-btn.open { border-color: var(--accent); }
.picker-pop { position: fixed; z-index: 30; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow); max-width: calc(100vw / var(--ui-zoom, 1) - 16px); }
.picker-list { display: flex; flex-direction: column; overflow-y: auto; min-height: 0; }
.picker-group { position: sticky; top: 0; background: var(--panel-2); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 6px 3px; }
.picker-opt { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border: none; border-radius: 5px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.picker-opt.active { background: var(--border); }
.picker-opt.clear { color: var(--muted); font-style: italic; }
.picker-empty { padding: 8px 6px; }
.opt-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.opt-main .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-name { font-weight: 600; }
.opt-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; max-width: 130px; text-align: right; }
.picker-fav { margin-left: auto; flex-shrink: 0; padding: 0 4px; font-size: 16px; line-height: 1; color: var(--muted); opacity: 0.45; }
.picker-opt:hover .picker-fav, .picker-opt.active .picker-fav { opacity: 1; }
.picker-fav:hover { color: var(--accent); }
.picker-fav.on { color: var(--accent); opacity: 1; }

/* ---------------------------------------------------------------- my builds */
.buildtabs { display: flex; flex-wrap: wrap; gap: 6px; }
.buildtab { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border-2); background: var(--bg-2); color: var(--text); cursor: pointer; }
.buildtab b { color: var(--ok); }
.buildtab.active { border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.buildname { width: 280px; max-width: 100%; }
.scorebar { position: sticky; top: -18px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.scorebar-total b { font-size: 20px; color: var(--ok); }
.tcount { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--bg-2); }
.score-delta { display: inline-flex; align-items: baseline; gap: 4px; font-size: 13px; }
.delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--err); }
.delta.same { color: var(--muted); }
.table.equip.editor td { vertical-align: top; }
.table.equip.editor .icon-cell { padding-top: 10px; }
.table.equip.editor .piece { padding-top: 14px; }
.table.equip.editor .decos { width: 250px; }
.piecepick { min-width: 220px; }
.piece-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--text); }
.check input { accent-color: var(--accent); }
.pairpick { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; align-items: center; }
.slotpicks { display: flex; flex-direction: column; gap: 4px; }
.slotpick { width: 100%; padding: 3px 8px 3px 4px; }
.slotpick.vacant .slotpick-name { color: var(--muted); font-style: italic; }
.slotpick.bad { border-color: var(--err); }
.slotpick-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; }
.tcheck.met { border-color: rgba(95, 191, 122, 0.5); }
.tcheck.miss { border-color: var(--err); background: rgba(224, 90, 79, 0.1); }
.build-actions { display: flex; gap: 6px; }
.table.attack-damage td, .table.attack-damage th { padding: 5px 8px; font-variant-numeric: tabular-nums; }
.table.attack-damage tr.attack-group td { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding-top: 12px; border-bottom-color: var(--border-2); }
.table.attack-damage tr.current td { background: rgba(227, 182, 78, 0.08); }
.dmgbar-cell { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.dmgbar-track { flex: 0 0 90px; height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.dmgbar { display: block; height: 100%; border-radius: 3px; background: rgba(95, 191, 122, 0.55); }
.dmgbar-value { min-width: 52px; }
@media (max-width: 700px), (pointer: fine) and (max-width: 1050px) {
  .table.attack-damage .narrow-hide, .table.attack-hits .narrow-hide, .dmgbar-track { display: none; }
  .table.attack-damage tr.attack-detail-row > td { padding-left: 8px; }
  .attack-trace ul { columns: 1; }
}
.table.attack-damage tr.attack-row { cursor: pointer; }
.table.attack-damage tr.attack-row:hover td { background: var(--panel-2); }
.table.attack-damage tr.attack-row.open td { border-bottom-color: transparent; }
.row-toggle { display: inline-block; width: 18px; color: var(--text); opacity: 0.75; font-size: 14px; line-height: 1; }
.table.attack-damage tr.attack-detail-row > td { padding: 0 8px 12px 30px; background: var(--bg-2); }
.attack-detail { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.attack-detail p { margin: 0; }
.table.attack-hits td, .table.attack-hits th { padding: 4px 8px; font-size: 13px; }
.table.attack-hits tbody + tbody tr.step-head td { border-top: 1px solid var(--border-2); }
.table.attack-hits tr.step-head td { padding-top: 10px; }
.table.attack-hits .step-title { font-weight: 600; margin-right: 6px; }
.table.attack-hits .step-stats { margin-left: 6px; }
.table.attack-hits tr.procs td { color: var(--muted); }
.table.attack-hits tr.shockwave-row td { color: var(--set); border-top-color: transparent; }
.table.attack-hits tr.shockwave-row td:first-child { padding-left: 22px; }
.table.attack-hits tr.shockwave-row .muted { color: var(--muted); }
.table.attack-hits tfoot td { border-top: 1px solid var(--border-2); border-bottom: none; }
.table.attack-hits .total-cell { font-weight: 700; color: var(--ok); }
.attack-trace summary { font-size: 12.5px; }
.mode-pick { display: inline-flex; align-items: center; gap: 8px; }
.nowrap { white-space: nowrap; }
.attack-trace ul { margin: 6px 0 0; padding-left: 18px; columns: 2; column-gap: 28px; font-size: 12px; color: var(--muted); }
.attack-trace li { break-inside: avoid; }
.scored-badge { margin-left: 8px; padding: 0 6px; border-radius: 4px; font-size: 10.5px; color: var(--accent); border: 1px solid rgba(227, 182, 78, 0.5); white-space: nowrap; }
.mine-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scored-on { margin: 0 0 8px; }
.scored-on b { color: var(--text); }

/* ---------------------------------------------------------------- compare */
.compare { display: flex; flex-direction: column; gap: 14px; }
.compare h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.compare-metrics { max-width: 640px; }
.compare-metrics td, .compare-metrics th { font-variant-numeric: tabular-nums; }
.compare-metrics tr.headline td { font-weight: 700; font-size: 15px; }
.compare-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.compare-skills td { padding: 4px 8px; }
.bonuslist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.compare-equip .piece { width: 80px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.compare-equip tr.differs td { background: rgba(227, 182, 78, 0.07); }
.compare-equip tr.differs .piece { color: var(--accent); }
.equipview { display: flex; flex-direction: column; gap: 3px; }
.equipview-decos { display: inline-flex; gap: 3px; }

/* the build editor stacks each row on narrow screens: icon | piece, then skills and slots side by side (one column on phones) */
@media (max-width: 1100px), (pointer: fine) and (max-width: 1650px) {
  .table.equip.editor, .table.equip.editor tbody { display: block; }
  .table.equip.editor tr { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "icon name name" "icon skills decos"; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .table.equip.editor tr:last-child { border-bottom: none; }
  .table.equip.editor td { border: none; padding: 0; }
  .table.equip.editor .icon-cell { grid-area: icon; padding-top: 2px; }
  .table.equip.editor .piece { display: none; }
  .table.equip.editor .name { grid-area: name; min-width: 0; }
  .table.equip.editor .skills { grid-area: skills; }
  .table.equip.editor .decos { grid-area: decos; width: auto; }
}
@media (max-width: 600px), (pointer: fine) and (max-width: 900px) {
  .table.equip.editor tr { grid-template-columns: 32px minmax(0, 1fr); grid-template-areas: "icon name" "icon skills" "icon decos"; }
  .piecepick { min-width: 0; width: 100%; }
}

/* ---------------------------------------------------------------- inventory (profile weapons) */
.inv-group + .inv-group { margin-top: 18px; }
.inv-group h3 { font-size: 14px; margin: 4px 0 6px; gap: 8px; }
.inv-group-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.inv-legend { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.lg-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--armor); margin-right: 4px; vertical-align: middle; }
.lg-dia { display: inline-block; width: 10px; height: 10px; transform: rotate(45deg); background: var(--ok); border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.lg-dia.stale { background: transparent; border: 2px dashed var(--warn); }
.inv-rows { display: flex; flex-direction: column; }
.inv-row { display: grid; grid-template-columns: 22px 220px minmax(160px, 1fr) 190px 104px; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--border); }
.inv-links { display: flex; gap: 6px; align-items: center; }
.inv-actions { gap: 0; justify-content: flex-end; }
.inv-actions .mud-button-root { min-width: 0; padding: 2px 8px; }
.inv-actions .inv-dup-icon { font-size: 15px; }
.inv-row-head { padding: 4px 6px; color: var(--muted); font-size: 11.5px; border-bottom-color: var(--border-2); }
.inv-row.inv-open { background: rgba(79, 163, 230, 0.06); }
.inv-row.inv-compared { background: rgba(227, 182, 78, 0.08); }
.inv-row .spinner { display: inline-block; vertical-align: middle; width: 12px; height: 12px; }
.inv-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.inv-name-link { font-weight: 700; font-size: 14px; text-decoration: none; color: var(--text); }
.inv-name-link:hover { text-decoration: underline; }
.inv-track { position: relative; height: 36px; }
.inv-track.ticks { height: 16px; font-size: 10.5px; }
.inv-track.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.inv-track .axis { position: absolute; left: 0; right: 0; top: 19px; height: 2px; background: var(--border); }
.inv-track .grid { position: absolute; top: 8px; bottom: 6px; width: 1px; background: rgba(255, 255, 255, 0.05); }
.inv-track .span { position: absolute; top: 18px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, rgba(127, 209, 196, 0.35), rgba(95, 191, 122, 0.85)); }
.inv-track .mk { position: absolute; transform: translateX(-50%); }
.inv-track .mk.mine { top: 12px; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--armor); background: var(--panel); }
.inv-track .mk.pick { top: -3px; color: var(--accent); font-size: 16px; line-height: 1; text-shadow: 0 0 3px #000; z-index: 2; }
.inv-track .mk.ceil { top: 13px; width: 13px; height: 13px; transform: translateX(-50%) rotate(45deg); background: var(--ok); border-radius: 2px; }
.inv-track .mk.ceil.stale { background: var(--panel); border: 2px dashed var(--warn); }
.inv-track .mk-tag { position: absolute; top: -3px; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.inv-track .mk-tag.none { left: 50%; top: 11px; }
.inv-nums { display: grid; grid-template-columns: auto auto; gap: 1px 10px; margin: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.inv-nums dt { color: var(--muted); white-space: nowrap; }
.inv-nums dd { margin: 0; text-align: right; font-weight: 700; white-space: nowrap; }
@media (max-width: 900px), (pointer: fine) and (max-width: 1350px) {
  .inv-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .inv-row > .inv-nums { grid-row: 1; grid-column: 3; }
  .inv-row > .inv-track { grid-row: 2; grid-column: 1 / -1; }
  .inv-row > .inv-actions { grid-row: 3; grid-column: 1 / -1; }
  .inv-row-head { display: none; }
}
.verdict { display: flex; gap: 16px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); background: linear-gradient(90deg, rgba(95, 191, 122, 0.1), transparent 70%); border: 1px solid rgba(95, 191, 122, 0.35); }
.verdict.same { background: linear-gradient(90deg, rgba(154, 161, 173, 0.1), transparent 70%); border-color: var(--border-2); }
.verdict-big { font-size: 24px; font-weight: 800; line-height: 1.15; min-width: 64px; }
.verdict p { margin: 2px 0; }
.h2h-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.h2h { display: grid; grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.h2h > div { padding: 7px 12px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.h2h .l { text-align: right; }
.h2h .mid { text-align: center; color: var(--muted); font-size: 12px; background: var(--bg-2); }
.h2h .hd { background: var(--panel-2); font-weight: 700; }
.h2h .same { color: var(--muted); }
.h2h .diffcell { background: rgba(227, 182, 78, 0.08); }
.h2h .win { color: var(--ok); font-weight: 700; }
.h2h-bars { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.pairbars { display: flex; flex-direction: column; gap: 3px; }
.pairbars span { display: block; height: 8px; border-radius: 3px; }
.bar-a, .sw-a { background: rgba(95, 191, 122, 0.75); }
.bar-b, .sw-b { background: rgba(79, 163, 230, 0.75); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: middle; }
.row-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1100px), (pointer: fine) and (max-width: 1650px) { .h2h-layout { grid-template-columns: 1fr; } }
.elem-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 6px; vertical-align: middle; }
.stale-badge { margin-left: 6px; padding: 0 6px; border-radius: 4px; font-size: 11px; color: var(--warn); border: 1px solid rgba(232, 176, 75, 0.5); }
.pickstar { color: var(--accent); }
.unsaved-badge { margin-left: 6px; padding: 0 6px; border-radius: 4px; font-size: 11px; color: var(--accent-2); border: 1px solid rgba(79, 163, 230, 0.5); }
.btn-row.nowrap { flex-wrap: nowrap; }

/* condition presets per weapon type */
.cond.overridden { border-style: dashed; border-color: var(--accent-2); }
.ovr { margin-left: 8px; padding: 0 5px; border-radius: 4px; font-size: 10px; font-weight: 500; color: var(--accent-2); border: 1px solid rgba(79, 163, 230, 0.5); text-transform: uppercase; letter-spacing: 0.04em; }
.chip.ovr-chip { border-color: rgba(79, 163, 230, 0.5); color: var(--accent-2); }

/* a hand-entered build's own conditions and the stats they give */
.build-cond-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 16px; align-items: start; }
.build-conds { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cond-grid.compact { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 6px; }
.cond-grid.compact .cond { padding: 7px 10px; }
.cond-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-screen { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.status-screen h4 { margin: 0 0 6px; font-size: 13px; }
.status-screen dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 8px; font-size: 13px; }
.status-screen dt { color: var(--muted); }
.status-screen dd { margin: 0; }
.status-screen dd b { font-size: 16px; }
.status-screen .mods { columns: 1; }
@media (max-width: 900px), (pointer: fine) and (max-width: 1350px) { .build-cond-layout { grid-template-columns: 1fr; } }



/* ---------------------------------------------------------------- MudBlazor */
:root:root {
  --mud-typography-default-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mud-typography-button-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mud-typography-body1-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mud-typography-body2-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mud-typography-default-size: 14px;
  --mud-typography-body1-size: 14px;
  --mud-typography-body2-size: 13px;
  --mud-typography-button-size: 13px;
}
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.mud-button-root { text-transform: none; letter-spacing: 0; white-space: nowrap; }
.mud-input-control { margin-top: 0; }
.mud-input.mud-input-outlined { background: var(--bg-2); }
.mud-input-control.number-field { flex: 0 0 auto; }
.mud-input-control.selectbox { min-width: 160px; }
.mud-list-item.select-group { opacity: 1 !important; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; min-height: 0; padding-top: 8px; padding-bottom: 2px; }
.mud-alert.alert-box { padding: 4px 12px; font-size: 13px; }
.mud-alert.alert-box .mud-alert-message { padding: 4px 0; }
.mud-snackbar { font-size: 14px; }
.configbar .mud-input-control.configsel { width: 210px; flex: 0 0 auto; }
.configpick .mud-icon-button { padding: 4px; }
.toggle-row { display: flex; align-items: flex-start; gap: 6px; }
.toggle-row .mud-switch { margin: -4px 0 0 -8px; }
.toggle-row.disabled .toggle-text { opacity: 0.5; }
.searchbox { flex: 1; min-width: 200px; }
.searchselect-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; }
.mud-list.searchselect-list .mud-list-item { min-height: 32px; padding-top: 4px; padding-bottom: 4px; }

/* picker (searchable dropdown) */
.picker-anchor { position: relative; display: inline-flex; max-width: 100%; }
.picker-anchor.block { display: flex; width: 100%; }
.picker-anchor.block .picker-btn { width: 100%; }
.mud-popover.picker-pop { width: 400px; max-width: calc(100vw - 16px); background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.picker-pop-body { display: flex; flex-direction: column; gap: 6px; padding: 8px; max-height: 460px; }
.picker-pop-body .picker-list { max-height: 380px; }

/* the skill card as a tooltip */
.mud-tooltip.skilltip-pop { background: transparent; padding: 0; box-shadow: none; max-width: none; }
.skilltip-pop .skilltip { position: static; pointer-events: auto; }
.skillhover { display: inline-flex; }
.decohover { display: inline-flex; }
.decotip { display: flex; flex-direction: column; gap: 6px; width: 320px; }
.decotip-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); font-size: 12.5px; }
.decotip .skilltip { width: auto; }
/* the scored attack or sequence (ScoredAttack) */
.attack-chip {
  display: inline-flex; align-items: center; vertical-align: middle; max-width: 100%; padding: 1px 5px 1px 9px; border: 1px solid var(--border-2);
  border-radius: 999px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.attack-chip-name { overflow: hidden; text-overflow: ellipsis; }
.attack-chip:not(:has(.infohover)) { padding-right: 9px; }
.sequence-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }
/* the (i) of InfoHover and its tooltip */
.infohover { display: inline-flex; vertical-align: middle; margin-left: 4px; }
.info-i {
  display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--border-2);
  color: var(--muted); font: italic 700 10px/1 Georgia, serif; cursor: help; user-select: none;
}
.info-i:hover, .info-i:focus-visible { color: var(--text); border-color: var(--muted); outline: none; }
.mud-tooltip.infotip-pop { background: var(--panel-2); color: var(--text); border: 1px solid var(--border-2); box-shadow: var(--shadow); padding: 8px 10px; max-width: 420px; text-align: left; }
.infotip { font-size: 12.5px; line-height: 1.45; display: flex; flex-direction: column; gap: 4px; }
.infotip ol, .infotip ul { margin: 0; padding-left: 18px; }
.infotip .muted { color: var(--muted); }

.import-summary { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.grants { display: inline-flex; flex-wrap: wrap; gap: 4px; }
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 10px 16px; background: #5a1f1a; color: #fff; z-index: 1000; }
#blazor-error-ui .reload { color: #ffd479; margin-left: 8px; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }

/* ---------------------------------------------------------------- comparing builds */
.chip.gain { border-color: rgba(95, 191, 122, 0.55); background: rgba(95, 191, 122, 0.08); }
.chip.gain b { color: var(--ok); }
.chip.loss { border-color: rgba(224, 90, 79, 0.55); background: rgba(224, 90, 79, 0.08); color: #f0a29b; }
.chip.loss b { color: var(--err); }
.chip.current-attack { border-color: rgba(227, 182, 78, 0.6); }
.slotstrip-wrap { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slotstrip { display: inline-flex; gap: 3px; }
.slotstrip-cell { width: 26px; height: 26px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); opacity: 0.32; }
.slotstrip-cell img { width: 20px; height: 20px; }
.slotstrip-cell.swap { opacity: 1; border-color: var(--accent); background: rgba(227, 182, 78, 0.16); }
.slotstrip-cell.regem { opacity: 0.9; border: 1px dashed rgba(227, 182, 78, 0.8); }
.table.swaplist td { padding: 6px 8px; vertical-align: top; }
.swaplist .swap-slot { width: 96px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.swaplist .swap-arrow { width: 24px; color: var(--muted); text-align: center; }
.swaplist .swap-from { color: var(--muted); }
.swap-piece { display: flex; flex-direction: column; gap: 2px; }
.swap-name { font-weight: 600; }
.diffstrip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border); font-size: 12.5px; }
.statchips.start { margin-left: 0; }
.table-scroll { overflow-x: auto; }

/* the compare tray */
.tray { position: fixed; left: 236px; right: 16px; bottom: 40px; z-index: 20; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; background: #262c39; border: 1px solid var(--accent); border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55); }
.tray-title { font-weight: 700; white-space: nowrap; }
/* up to twenty builds: one line that scrolls sideways */
.tray-items { display: flex; gap: 8px; flex: 1 1 300px; min-width: 0; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.tray-item { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 2px 2px 2px 8px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border-2); font-size: 12.5px; }
.tray-item.base { border-color: var(--accent); }
.tray-item img { width: 18px; height: 18px; }
.tray-item b { color: var(--ok); }
.tray-x { border: none; background: none; color: var(--muted); cursor: pointer; padding: 0 6px; }
.tray-x:hover { color: var(--text); }
.content.with-tray { padding-bottom: 120px; }
@media (max-width: 900px), (pointer: fine) and (max-width: 1450px) { .tray { left: 12px; right: 12px; } }

/* results against a baseline */
.table.results-table td { vertical-align: middle; }
.results-table td.result-build { min-width: 240px; max-width: 420px; vertical-align: top; }
.results-table .result-sets { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.results-table .result-armor { margin-top: 4px; white-space: normal; line-height: 1.4; }
.results-table td.result-skills { vertical-align: top; }
.results-table td.result-skills .chip-row { gap: 4px; }
.results-table .dmg { font-size: 15px; color: var(--ok); }
.results-table .dmg.plain { color: var(--text); }
.results-table tr.result-base td { background: rgba(227, 182, 78, 0.05); }
.results-table tr.result-row.clickable { cursor: pointer; }
.results-table tr.result-row.clickable:hover td { background: var(--panel-2); }
.results-table tr.result-row.open td { border-bottom-color: transparent; background: var(--panel-2); }
.results-table tr.result-detail-row > td { padding: 0; background: var(--bg-2); }
.result-detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; padding: 12px 16px 14px; border-left: 3px solid var(--accent); }
.build .result-detail { padding: 10px 0 0; border-left: none; }
.rank-chip { font-weight: 700; padding: 2px 9px; border-radius: 6px; background: var(--border); display: inline-block; }
.rank-chip.best { background: var(--ok); color: #0d1a10; }
.badge-mini { margin-left: 6px; padding: 0 5px; border-radius: 4px; font-size: 10.5px; color: var(--accent-2); border: 1px solid rgba(79, 163, 230, 0.55); }
.badge-mini.warnbadge { color: var(--warn); border-color: rgba(232, 176, 75, 0.55); cursor: help; }
@media (max-width: 1100px), (pointer: fine) and (max-width: 1650px) { .result-detail { grid-template-columns: 1fr; } }

/* the Compare tab */
.cmp { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.cmp th, .cmp td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
/* many columns scroll sideways inside the card (and down, so the column heads stay in view); the row heads stay on the left */
.cmp-scroll { overflow: auto; max-height: calc(100vh / var(--ui-zoom, 1) - 140px); overscroll-behavior-x: contain; }
.cmp .rowh { width: 150px; position: sticky; left: 0; z-index: 1; background: var(--panel); box-shadow: inset -1px 0 0 var(--border); color: var(--muted); font-size: 12.5px; font-weight: 500; }
.cmp thead th { position: sticky; top: 0; z-index: 3; background: var(--panel-2); border-bottom: 1px solid var(--border-2); font-weight: 400; color: var(--text); font-size: 13px; }
.cmp thead th.rowh { left: 0; z-index: 4; }
.cmp tr.cmp-toggle td { padding-top: 5px; padding-bottom: 5px; }
.cmp tr.cmp-toggle .linklike { white-space: nowrap; }
.cmp tr.cmp-diff td { padding-top: 4px; padding-bottom: 4px; }
/* long names (set bonus tiers) wrap inside a column instead of running into the next */
.cmp td .chip-row .chip, .cmp .rowh .chip { white-space: normal; max-width: 100%; line-height: 1.35; padding-top: 1px; padding-bottom: 1px; }
/* a row heading never spills over the first column (it stays on top of it while scrolling sideways) */
.cmp .rowh { overflow: hidden; overflow-wrap: anywhere; }
.free-slots { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; font-size: 12.5px; }
.free-k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.cmp thead th.basecol { box-shadow: inset 0 3px 0 var(--accent); background: #2b2b2c; }
.cmp td.basecol { background: rgba(227, 182, 78, 0.045); }
.cmp tr.cmp-sec td { background: var(--bg-2); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; padding: 6px 10px; border-bottom-color: var(--border-2); }
.cmp td.val { font-variant-numeric: tabular-nums; }
.cmp td.val .v { font-weight: 700; }
.cmp td.val .d { display: block; font-size: 12px; }
.cmp td.best .v { color: var(--ok); }
.cmp tr.headline .v { font-size: 20px; font-weight: 800; }
.cmp td.changed { box-shadow: inset 3px 0 0 rgba(227, 182, 78, 0.75); background: rgba(227, 182, 78, 0.06); }
.cmp td.regem { box-shadow: inset 3px 0 0 rgba(227, 182, 78, 0.35); }
.cmp .cmp-d { margin-left: 6px; }
.cmp-bar { display: block; height: 5px; width: 130px; max-width: 100%; margin-top: 4px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.cmp-bar > span { display: block; height: 100%; border-radius: 3px; background: rgba(95, 191, 122, 0.6); }
.colhead { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.colhead-top { display: flex; align-items: center; gap: 6px; }
.colhead-tools { margin-left: auto; display: flex; gap: 2px; }
.colhead-tools button { background: none; border: 1px solid transparent; color: var(--muted); border-radius: 4px; cursor: pointer; padding: 0 5px; font-size: 13px; }
.colhead-tools button:hover { border-color: var(--border-2); color: var(--text); }
.colhead-name { font-weight: 700; font-size: 14px; }
.colhead-weapon { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.colhead-weapon img { width: 20px; height: 20px; }
.colhead-weapon b { color: var(--text); font-weight: 600; }
.badge-base { padding: 0 6px; border-radius: 4px; font-size: 11px; color: var(--accent); border: 1px solid rgba(227, 182, 78, 0.6); white-space: nowrap; }
.src-badge { padding: 0 6px; border-radius: 4px; font-size: 10.5px; white-space: nowrap; border: 1px solid var(--border-2); color: var(--muted); }
.src-badge.run { color: var(--accent-2); border-color: rgba(79, 163, 230, 0.55); }
.src-badge.mine { color: var(--armor); border-color: rgba(127, 209, 196, 0.55); }
.ok-badge { padding: 0 6px; border-radius: 4px; font-size: 11px; color: var(--ok); border: 1px solid rgba(95, 191, 122, 0.55); }
.draft-badge { margin-left: 6px; padding: 0 6px; border-radius: 4px; font-size: 10.5px; font-weight: 600; color: #ff9ecb; border: 1px dashed rgba(255, 122, 182, 0.7); }
.cond-diff { padding: 8px 12px; border-radius: 6px; border: 1px solid rgba(232, 176, 75, 0.5); background: rgba(232, 176, 75, 0.06); font-size: 13px; }
.cond-diff ul { margin: 4px 0 6px; padding-left: 18px; color: var(--muted); }
.target-diff { margin: 4px 0 6px; padding-left: 18px; }
.cmp-controls { column-gap: 24px; }
.cmp-control { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.difflist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.difflist li { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.difflist .k { color: var(--muted); min-width: 52px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }

/* a draft next to the build it was made from */
.table.equip.editor.side-by-side th { font-size: 12px; }
.table.equip.editor .was { width: 210px; color: var(--muted); background: rgba(227, 182, 78, 0.035); vertical-align: top; padding-top: 12px; }
.table.equip.editor .was-name { color: var(--text); opacity: 0.85; font-weight: 600; font-size: 13px; }
.table.equip.editor tr.row-changed td { background: rgba(227, 182, 78, 0.05); }
.table.equip.editor tr.row-changed td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.table.equip.editor .effect { width: 170px; text-align: right; vertical-align: top; padding-top: 12px; }
.table.equip.editor .was-label { display: none; }
@media (max-width: 1100px), (pointer: fine) and (max-width: 1650px) {
  .table.equip.editor.side-by-side thead { display: none; }
  .table.equip.editor.side-by-side tr { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "icon was effect" "icon name name" "icon decos decos"; }
  .table.equip.editor.side-by-side .was { grid-area: was; width: auto; padding: 6px 10px; border-radius: 6px; }
  .table.equip.editor.side-by-side .was-label { display: block; }
  .table.equip.editor.side-by-side .effect { grid-area: effect; width: auto; padding: 4px 0 0; }
  .table.equip.editor.side-by-side tr.row-changed td:first-child { box-shadow: none; }
  .table.equip.editor.side-by-side tr.row-changed { box-shadow: inset 3px 0 0 var(--accent); padding-left: 6px; }
}
@media (max-width: 600px), (pointer: fine) and (max-width: 900px) {
  .table.equip.editor.side-by-side tr { grid-template-columns: 32px minmax(0, 1fr); grid-template-areas: "icon was" "icon effect" "icon name" "icon decos"; }
  .table.equip.editor.side-by-side .effect { text-align: left; }
  .table.equip.editor.side-by-side .effect-skills { justify-content: flex-start; }
}
.effect-delta { font-size: 14px; }
.effect-skills { justify-content: flex-end; margin: 3px 0; }
.table.upgrades td { vertical-align: middle; }

/* weapon tuning: the weapon a build got and how every choice of each optimized part does on its armor */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; margin-bottom: 8px; }
.weapon-options { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); }
.weapon-options-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.weapon-options-head .label { color: var(--muted); font-size: 12px; }
.weapon-options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px 18px; margin-top: 6px; }
.weapon-option-part h5 { margin: 0 0 2px; font-size: 12.5px; font-weight: 600; }
.weapon-option-part ol { margin: 0; padding-left: 18px; font-size: 12.5px; }
.weapon-option-part li { display: flex; justify-content: space-between; gap: 10px; }
.weapon-option-part li.chosen { color: var(--ok); font-weight: 600; }
.weapon-option-part li.chosen .muted { color: var(--ok); font-weight: 400; }
.weapon-line { white-space: normal; max-width: 260px; margin-top: 2px; }
.result-detail-row .weapon-options { margin: 0 0 8px; }

/* ---------------------------------------------------------------- wiki */
.wiki { display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr); gap: 16px; align-items: start; max-width: 1400px; }
.wiki-side { position: sticky; top: 0; display: flex; flex-direction: column; max-height: calc(100vh / var(--ui-zoom, 1) - 150px); overflow: hidden; }
.wiki-tools { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 8px; border-bottom: 1px solid var(--border); }
.wiki-list { overflow-y: auto; display: flex; flex-direction: column; padding: 4px 0 8px; }
.wiki-count { padding: 4px 12px; }
.wiki-row { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: none; border-left: 3px solid transparent; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.wiki-row:hover { background: var(--panel-2); }
.wiki-row.active { background: var(--panel-2); border-left-color: var(--accent); }
.wiki-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiki-flag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 5px; border-radius: 4px; border: 1px solid rgba(79, 195, 247, 0.5); color: var(--weapon); white-space: nowrap; }
.wiki-flag.gogma { border-color: rgba(227, 182, 78, 0.5); color: var(--set); }
.wiki-main { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.wiki-back { display: none; align-self: flex-start; }
.wiki-page { max-width: none; }
.wiki-head { padding: 14px 18px; border-left: 3px solid var(--armor); }
.wiki-head.weapon { border-left-color: var(--weapon); }
.wiki-head.set { border-left-color: var(--set); }
.wiki-head.group { border-left-color: var(--group); }
.wiki-title { display: flex; align-items: center; gap: 12px; }
.wiki-title h1 { font-size: 20px; }
.wiki-desc { margin: 10px 0 0; }
.table.wiki-levels td { vertical-align: top; }
.wiki-lv { width: 1%; white-space: nowrap; }
.wiki-game { width: 40%; font-size: 12.5px; }
.wiki-fx { font-weight: 600; }
.wiki-fx > div + div { margin-top: 2px; }
.wiki-subtable h3, .wiki-src h3, .wiki-subhead { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 4px 0 8px; }
.wiki-subtable td:not(:first-child) { white-space: nowrap; }
.wiki-notes { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; display: grid; gap: 3px; }
.wiki-source { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin: 0; }
.wiki-conf { flex: none; padding: 0 6px; border-radius: 4px; border: 1px solid var(--border-2); color: var(--muted); }
.wiki-conf.high { color: var(--ok); border-color: rgba(95, 191, 122, 0.5); }
.wiki-conf.medium { color: var(--warn); border-color: rgba(232, 176, 75, 0.5); }
.wiki-conf.low { color: var(--err); border-color: rgba(224, 90, 79, 0.5); }
.wiki-src + .wiki-src { border-top: 1px solid var(--border); padding-top: 12px; }
.wiki-src .chip { white-space: normal; }
.table.wiki-armor-src td { padding-top: 4px; padding-bottom: 4px; }
.wiki-weapons { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 10px 18px; }
.wiki-weapon-group { display: flex; flex-direction: column; gap: 4px; }
.wiki-weapon-names { display: flex; flex-direction: column; padding-left: 26px; font-size: 12.5px; color: var(--muted); }
.wiki-bonus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.wiki-bonus { padding: 12px 14px; border-left: 3px solid var(--set); }
.wiki-bonus.group { border-left-color: var(--group); }
.wiki-bonus-head { display: flex; align-items: center; gap: 8px; }
.wiki-bonus-name { font-weight: 600; color: var(--text); }
.wiki-tiers { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.table.wiki-pieces th, .table.wiki-pieces td { padding-left: 5px; padding-right: 5px; }
.table.wiki-pieces td { vertical-align: top; }
.table.wiki-pieces .num { white-space: nowrap; }
.table.wiki-pieces .res { padding-left: 3px; padding-right: 3px; }
.wiki-piece-skills { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.wiki-piece-skills > * { white-space: nowrap; }
.wiki-piece-skills .linklike { color: var(--text); text-align: left; }
.wiki-piece-skills.sum { flex-direction: row; flex-wrap: wrap; gap: 2px 14px; }
.wiki-total td { border-top: 2px solid var(--border-2); }
.wiki-list-head { padding: 10px 12px 2px; text-transform: uppercase; letter-spacing: 0.06em; }
.wiki-row-note { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiki-head.item, .wiki-head.meal { border-left-color: var(--accent); }
.wiki-item-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-bottom: 10px; }
.wiki-item-stats > div { display: flex; flex-direction: column; gap: 2px; }
.wiki-item-stats b { font-size: 16px; }
.wiki-item-effects { margin: 0 0 10px; padding-left: 18px; display: grid; gap: 4px; font-weight: 600; }
.wiki-stacking { margin: 0 0 10px; }
.wiki-stacking .tiny { text-transform: uppercase; letter-spacing: 0.06em; margin-right: 6px; }
.table.wiki-item-table td { padding-top: 4px; padding-bottom: 4px; }
.table.wiki-item-table td:nth-child(2) { white-space: nowrap; }
/* meal tables carry sentences: let them wrap, keep the first column readable */
.wiki-meal-table td:not(:first-child) { white-space: normal; }
.wiki-meal-table td:first-child { min-width: 10em; }
@media (max-width: 900px), (pointer: fine) and (max-width: 1350px) {
  .wiki { grid-template-columns: 1fr; }
  .wiki-side { position: static; max-height: none; }
  .wiki.has-entry .wiki-side { display: none; }
  .wiki:not(.has-entry) .wiki-main { display: none; }
  .wiki-back { display: inline; }
  .wiki-game { width: auto; }
}
