/* Swap System v0.1 (ui/windows/Swap*.js, swap*.js): the window, its two lists, the bundle editor on the Personnage paper doll, the macro editor, the icon of a macro on a bar. Esprit paper like the other windows. */
.sw-win { min-height: 420px; }
.sw-content { display: flex; flex-direction: column; gap: 6px; }
.sw-cols { display: flex; gap: 8px; align-items: flex-start; }
.sw-list { width: 150px; flex: none; display: flex; flex-direction: column; gap: 4px; }
.sw-listbtns { display: flex; flex-wrap: wrap; gap: 3px; }
.sw-listbtns .gf-btn { padding: 1px 8px; font-size: var(--fs-small); border-radius: 10px; }
.sw-items { display: flex; flex-direction: column; gap: 2px; max-height: 360px; overflow-y: auto; }
.sw-item { display: flex; align-items: center; gap: 5px; text-align: left; padding: 3px 5px; border: 1px solid #716c94; border-radius: 5px; background: #c2bfd4; color: var(--gf-ink); cursor: pointer; font-size: var(--fs-body); }
.sw-item:hover { background: #ceccdd; }
.sw-item.on { background: #dfdde9; box-shadow: inset 3px 0 0 #908bb2; border-color: #464262; }
.sw-iname { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.15; }
.sw-iname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-iname i { font-size: var(--fs-caption); font-style: normal; }
.sw-dot { width: 8px; height: 8px; border-radius: 50%; background: #918eab; flex: none; }
.sw-dot.ok { background: #46b04a; } .sw-dot.warn { background: #e0a020; } .sw-dot.bad { background: #d24646; }
.sw-main { flex: 1; min-width: 0; }
.sw-none { padding: 24px 12px; text-align: center; }
.sw-repair { font-size: var(--fs-small); }

.sw-ed { display: flex; flex-direction: column; gap: 6px; }
.sw-head { display: flex; flex-direction: column; gap: 4px; }
.sw-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sw-name { flex: 1; min-width: 110px; padding: 2px 6px; border: 1px solid #464262; border-radius: 4px; background: #ecebf2; color: var(--gf-ink); font-weight: 700; font-size: var(--fs-strong); }
.sw-kind { font-size: var(--fs-small); }
.sw-strict { font-size: var(--fs-body); font-weight: 700; display: flex; align-items: center; gap: 3px; cursor: pointer; }
.sw-apply, .gf-btn.go { background: linear-gradient(#bff0b4, #7ed36d); border-color: #2f7a2a; color: #123b10; }
.sw-last { font-size: var(--fs-body); font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.sw-last.ok { background: #dcf3d2; color: #1d5a1a; } .sw-last.warn { background: #f7e8bd; color: #7a5200; } .sw-last.bad { background: #f6d6d2; color: #8a1d16; }

.sw-cats { display: flex; flex-wrap: wrap; gap: 3px; }
.sw-cats .gfw-tab { flex: none; padding: 2px 8px; }
.sw-cats .gfw-tab.has { box-shadow: inset 0 -3px 0 #46b04a; }
.sw-cats .gfw-tab.on.has { box-shadow: inset 0 3px 0 #908bb2, inset 0 -3px 0 #46b04a; }
.sw-n { margin-left: 4px; font-size: var(--fs-caption); background: #46b04a; color: #fff; border-radius: 8px; padding: 0 5px; }
.sw-body { display: flex; gap: 8px; align-items: flex-start; }
.sw-stage { flex: none; width: 180px; padding: 8px 3px 4px; position: relative; background: radial-gradient(circle at 50% 45%, #d6d4e3, var(--gf-paper-dark) 70%); border: 1px solid #716c94; border-radius: 6px; }
.sw-stage .cw-doll.paper { flex: none; background-color: transparent; }
.sw-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sw-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.sw-tools .gf-btn { padding: 1px 9px; font-size: var(--fs-small); border-radius: 10px; }
.sw-hint { font-size: var(--fs-small); margin: 0; flex-basis: 100%; }

/* the tiles: three states and what would happen */
.sw-part { position: relative; cursor: pointer; }
.sw-part.sw-keep { opacity: 0.55; border-style: dashed !important; background: repeating-linear-gradient(45deg, #d5d3e1 0 4px, #c0bdd3 4px 8px) !important; }
.sw-part.sw-keep:hover { opacity: 0.9; }
.sw-sub { position: absolute; left: 0; right: 0; bottom: 1px; font-size: calc(7px * var(--ui-text)); text-align: center; color: #66627d; }
.sw-null { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-display); color: #8a1d16; font-weight: 800; }
.sw-part.sw-empty { background: #e2e1eb !important; border-color: #b4574c !important; }
.sw-part.st-same { box-shadow: 0 0 0 2px #46b04a; }
.sw-part.st-change { box-shadow: 0 0 0 2px var(--blue); }
.sw-part.st-missing, .sw-part.st-problem { box-shadow: 0 0 0 2px #d24646; }
.sw-part.st-missing img { filter: grayscale(1) opacity(0.6); }
.sw-effects { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; background: radial-gradient(circle at 50% 45%, #d6d4e3, var(--gf-paper-dark) 70%); border: 1px solid #716c94; border-radius: 6px; flex: none; width: 180px; }
.sw-eff { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 50px; }
.sw-eff .gf-tile { width: 44px; height: 44px; border: 2px solid var(--tier); border-radius: 3px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; position: relative; }
.sw-eff .gf-tile img { width: 38px; height: 38px; }
.sw-tier { font-size: var(--fs-micro); text-align: center; line-height: 1.05; color: #44405c; }
.sw-talents { display: flex; flex-direction: column; gap: 6px; width: 180px; flex: none; font-size: var(--fs-body); }
.sw-tlines { display: flex; flex-direction: column; gap: 4px; }
.sw-tlines.off { opacity: 0.5; }
.sw-tline { display: flex; flex-direction: column; gap: 1px; font-weight: 700; }
.sw-tline select, .sw-val { padding: 1px 3px; border: 1px solid #464262; border-radius: 4px; background: #ecebf2; color: var(--gf-ink); font-size: var(--fs-body); max-width: 100%; }
.sw-incl { font-weight: 700; display: flex; gap: 4px; align-items: flex-start; cursor: pointer; }

/* the expected result */
.sw-prev { padding: 6px 8px; background: var(--gf-paper-dark); border: 1px solid #716c94; border-radius: 6px; font-size: var(--fs-body); }
.sw-prev h4 { margin: 0 0 4px; font-size: var(--fs-body); color: #393650; }
.sw-prev ul { margin: 0 0 4px; padding-left: 16px; }
.sw-prev .from { color: #66627d; } .sw-prev .to { color: #1d5a1a; font-weight: 700; }
.sw-problems li { color: #8a1d16; }
.sw-verdict { color: #8a1d16; font-weight: 700; margin: 2px 0; }
.sw-untouched { font-size: var(--fs-small); margin: 4px 0 0; }

/* the menu of a tile */
.sw-menu { position: absolute; z-index: var(--z-menu); width: 230px; display: flex; flex-direction: column; gap: 2px; padding: 4px; background: #dfdde9; border: 2px solid #464262; border-radius: 6px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5); }
.sw-cmd, .sw-cand { text-align: left; padding: 3px 6px; border: 1px solid #837ea3; border-radius: 4px; background: #d0cede; color: var(--gf-ink); font-size: var(--fs-body); font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.sw-cmd:hover, .sw-cand:hover { background: #e1e0ea; border-color: #464262; }
.sw-candlist { display: flex; flex-direction: column; gap: 2px; max-height: 210px; overflow-y: auto; margin-top: 2px; }
.sw-cand img { width: 28px; height: 28px; flex: none; }
.sw-cand span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.sw-mini { padding: 0 6px; font-size: var(--fs-caption); border-radius: 6px; border-width: 1px; }


/* a macro on an action bar slot */
.mc-ico { position: relative; box-sizing: border-box; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.mc-ico img { width: 100%; height: 100%; }
.mc-glyph { width: 70%; height: 70%; color: #e4e3ec; display: flex; background: #393650; border-radius: 4px; padding: 4px; box-sizing: border-box; }
.mc-glyph .glyph { width: 100%; height: 100%; }
.mc-steps { margin: 2px 0 4px; padding-left: 18px; }

/* the second floating bar: the C / A panel's own look (ui-upperbars.css), its own width */
.abup.bar2 { --slot: clamp(30px, 2.6vw, 42px); }
.abup.bar2.vertical .abbars { flex-direction: column; }

/* a bundle on a bar: tag and tooltip */
.bt { max-width: 340px; }
.bt-list { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bt-row { display: flex; align-items: center; gap: 6px; font-size: var(--fs-body); }
.bt-row img { width: 22px; height: 22px; flex: none; }
.bt-nil { width: 22px; text-align: center; flex: none; opacity: 0.7; }
.bt-part { width: 96px; flex: none; opacity: 0.75; }
.bt-what { flex: 1; min-width: 0; font-weight: 700; }
.bt-st { flex: none; font-size: var(--fs-caption); padding: 0 5px; border-radius: 6px; background: rgba(255, 255, 255, 0.14); }
.bt-row.ok .bt-st { background: #2d7a3a; } .bt-row.new .bt-st { background: #4e496d; } .bt-row.bad .bt-st { background: #a8322d; }

.slot.macrowait .icon-wrap { filter: saturate(0.55) brightness(0.8); }
.bt-idx { width: 14px; text-align: center; font-weight: 800; flex: none; opacity: 0.8; }
.bt-row.ok .bt-st { background: #2d7a3a; }

/* tiles: the size of a bag tile, a name under them */
.sw-tile { position: relative; width: 44px; height: 44px; flex: none; overflow: hidden; border-radius: 5px; cursor: grab; }
.sw-tile:active { cursor: grabbing; }
.sw-tile.on { outline: 2px solid var(--blue); }
.sw-tile .mc-ico { position: absolute; inset: 0; }
.sw-tcell { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; }
.sw-tname { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-caption); font-weight: 700; text-align: center; }
.sw-cd { position: absolute; inset: 0; pointer-events: none; }
.sw-cdt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-small); font-weight: 800; color: #ebeaf1; text-shadow: var(--outline); pointer-events: none; }
.sw-grid { display: flex; flex-wrap: wrap; gap: 8px 6px; }
.sw-grid.tight { gap: 4px; }
.sw-drag { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); }
.sw-shelf { display: flex; flex-direction: column; gap: 6px; }
.sw-shelf h4 { margin: 4px 0 2px; font-size: var(--fs-body); }
.sw-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-small); }
.sw-lg { display: inline-flex; align-items: center; gap: 5px; }
.sw-sample { display: inline-block; width: 16px; height: 16px; flex: none; border-radius: 3px; }

/* the five steps of a macro */
.sw-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.sw-scell { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 74px; }
.sw-sidx { font-size: var(--fs-caption); font-weight: 800; color: #393650; }
.sw-stile { position: relative; width: 44px; height: 44px; overflow: hidden; border-radius: 5px; border: 2px solid #464262; background: radial-gradient(circle at 50% 40%, #e3e2ed, var(--gf-tile)); cursor: pointer; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.sw-stile img { width: 100%; height: 100%; pointer-events: none; }
.sw-stile .mc-ico { position: absolute; inset: 0; }
.sw-stile.empty { border-style: dashed; background: transparent; }
.sw-stile.over { outline: 2px solid var(--green); }
.sw-stile.now { outline: 2px solid var(--blue); box-shadow: 0 0 8px var(--blue); }
.sw-stile.bad { border-color: #d24646; }
.sw-plus { font-size: var(--fs-display); font-weight: 800; color: #66627d; }
.sw-sctl { display: flex; gap: 2px; }
.sw-ready { padding: 3px 8px; border-radius: 4px; font-size: var(--fs-body); font-weight: 700; background: #dad9e5; color: #393650; }
.sw-ready.ok { background: #dcf3d2; color: #1d5a1a; }
.sw-ready.wait { background: #dbe2fb; color: #26357a; }
.sw-ready.bad { background: #f6d6d2; color: #8a1d16; }
.sw-tray { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px; background: var(--gf-paper-dark); border: 1px solid #716c94; border-radius: 6px; }
.sw-trayline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-small); }
.sw-traylbl { font-weight: 700; }

/* FRAMES of the swap entries, loud on purpose: a thick coloured border with a glow, a striped base band and a flag with the letter (S bundle, M macro, M+S macro that swaps weapons).
   Teal = bundle, indigo = macro, split teal / indigo = macro with a weapon swap; the same on the bars, in the window and in the tooltips. */
.mc-ico { --fc: #35d6cc; --bg1: #17565c; --bg2: #0a2629; overflow: hidden; }
.mc-ico.is-macro { --fc: #8499ff; --bg1: #2f3f93; --bg2: #11183a; }
.mc-ico.is-swap, .mc-ico.is-macro { border: 3px solid var(--fc); background: radial-gradient(circle at 50% 35%, var(--bg1), var(--bg2)); box-shadow: 0 0 0 1px #0b0a10, inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 0 9px var(--fc); }
.mc-ico.is-swap::after, .mc-ico.is-macro::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 24%; pointer-events: none; background: repeating-linear-gradient(135deg, var(--fc) 0 4px, rgba(6, 8, 18, 0.55) 4px 8px); }
.mc-ico.is-macro.has-swap { border-color: transparent; border-image: linear-gradient(135deg, #35d6cc 0 50%, #8499ff 50% 100%) 1; }
.mc-ico.is-macro.has-swap::after { background: repeating-linear-gradient(135deg, #35d6cc 0 4px, #8499ff 4px 8px); opacity: 0.85; }
.mc-tag { position: absolute; right: 0; top: 0; z-index: 2; padding: 0 3px 1px 4px; border-radius: 0 0 0 6px; font-size: var(--fs-caption); font-weight: 900; line-height: 1.15; letter-spacing: 0.02em; background: var(--fc); color: #06141a; text-shadow: none; box-shadow: -1px 1px 0 #0b0a10; pointer-events: none; }
.mc-ico.has-swap .mc-tag { background: linear-gradient(90deg, #8499ff 52%, #35d6cc 52%); }
.sw-item.is-swap { border-left: 5px solid #35d6cc; }
.sw-item.is-macro { border-left: 5px solid #8499ff; }
.bt h4 { padding-left: 6px; border-left: 4px solid #35d6cc; }

/* the macro tracker (ui/macroTracker.js): --mt = the size chosen in the settings */
.mtrack { --mt: 1; position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: calc(var(--z-window-max) + 1); min-width: calc(220px * var(--mt)); max-width: calc(380px * var(--mt)); padding: calc(5px * var(--mt)) calc(8px * var(--mt)) calc(6px * var(--mt)); border-radius: var(--r-md); background: var(--surface); color: var(--text); border: 2px solid #8499ff; box-shadow: var(--bevel), var(--drop); }
.mtrack.hidden { display: none; }
.mtrack.ok { border-color: var(--green); } .mtrack.bad { border-color: var(--red); } .mtrack.stop, .mtrack.idle { border-color: var(--edge); }
.mt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: move; font-weight: 800; font-size: calc(var(--fs-body) * var(--mt)); }
.mtrack.locked .mt-head, .mtrack.locked .mt-chips, .mtrack.locked .mt-line { cursor: default; }
.mt-state { font-size: calc(var(--fs-caption) * var(--mt)); letter-spacing: 0.06em; padding: 0 5px; border-radius: 3px; background: #2f3f93; color: #dfe4ff; white-space: nowrap; }
.mtrack.ok .mt-state { background: #1f6a32; } .mtrack.bad .mt-state { background: #8a2b2b; } .mtrack.stop .mt-state, .mtrack.idle .mt-state { background: var(--accent-lo); }
.mt-chips { display: flex; gap: calc(4px * var(--mt)); margin: calc(5px * var(--mt)) 0 calc(3px * var(--mt)); }
.mt-chips:empty { display: none; }
.mt-chip { position: relative; width: calc(36px * var(--mt)); height: calc(36px * var(--mt)); flex: none; box-sizing: border-box; border: 2px solid var(--edge); border-radius: 4px; background: var(--surface-deep); overflow: hidden; }
.mt-ico { position: absolute; inset: 0; display: flex; } .mt-ico img, .mt-ico .mc-ico { width: 100%; height: 100%; }
.mt-n { position: absolute; right: 1px; bottom: 0; z-index: 2; font-size: calc(var(--fs-caption) * var(--mt)); font-weight: 900; color: #fff; text-shadow: var(--outline); }
.mt-cond, .mt-skip { position: absolute; left: 1px; top: 0; z-index: 2; font-size: calc(var(--fs-micro) * var(--mt)); font-weight: 900; padding: 0 2px; border-radius: 2px; background: #59d98e; color: #04200f; }
.mt-skip { left: auto; right: 1px; background: var(--accent-lo); color: #fff; }
.mt-chip.wait .mt-ico { filter: grayscale(0.6) brightness(0.65); }
.mt-chip.done { border-color: var(--green); } .mt-chip.done .mt-ico { filter: brightness(0.8); }
.mt-chip.now { border-color: #8499ff; box-shadow: 0 0 10px #8499ff; animation: mtPulse 0.7s ease-in-out infinite alternate; }
.mt-chip.skip { border-color: var(--edge); border-style: dashed; } .mt-chip.skip .mt-ico { filter: grayscale(1) brightness(0.5); }
.mt-chip.bad { border-color: var(--red); }
@keyframes mtPulse { to { filter: brightness(1.3); } }
.mt-line { font-size: calc(var(--fs-small) * var(--mt)); color: var(--muted); }
/* compact = the chips only (the line is the tooltip), minimal = one line */
.mtrack[data-mode="compact"] { min-width: 0; } .mtrack[data-mode="compact"] .mt-head, .mtrack[data-mode="compact"] .mt-line { display: none; } .mtrack[data-mode="compact"] .mt-chips { margin: 0; cursor: move; }
.mtrack[data-mode="compact"] .mt-chip { width: calc(28px * var(--mt)); height: calc(28px * var(--mt)); }
.mtrack[data-mode="minimal"] { min-width: 0; padding-top: calc(3px * var(--mt)); padding-bottom: calc(3px * var(--mt)); } .mtrack[data-mode="minimal"] .mt-head, .mtrack[data-mode="minimal"] .mt-chips { display: none; } .mtrack[data-mode="minimal"] .mt-line { color: var(--text); font-weight: 700; cursor: move; }

/* the options of a macro step */
.sw-stepsbox { display: flex; flex-direction: column; gap: 6px; }
.sw-stags { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; justify-content: space-between; pointer-events: auto; }
.sw-stag { font-size: var(--fs-micro); font-weight: 900; padding: 0 3px; border-radius: 2px; background: #59d98e; color: #04200f; }
.sw-stag.skip { background: var(--accent-lo); color: #fff; }
.sw-mini.on { background: linear-gradient(#c9c6d9, #8f8ab1); }
.sw-opts { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; background: var(--gf-paper-dark); border: 1px solid #716c94; border-left: 4px solid #59d98e; border-radius: 6px; font-size: var(--fs-body); }
.sw-optshead { display: flex; justify-content: space-between; align-items: center; }
.sw-optrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sw-optrow > span { width: 150px; flex: none; font-weight: 700; }
.sw-optrow select { max-width: 270px; padding: 1px 3px; border: 1px solid #464262; border-radius: 4px; background: #ecebf2; color: var(--gf-ink); font-size: var(--fs-body); }
.sw-opts .sw-optnum input { width: 56px; padding: 1px 4px; font-size: var(--fs-body); border: 1px solid #464262; border-radius: 4px; background: #ecebf2; color: var(--gf-ink); }
.sw-optsum { margin: 0; }

/* the Paramètres tab */
.sw-settings { display: flex; flex-direction: column; gap: 8px; }
.sw-set { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: var(--gf-paper-dark); border: 1px solid #716c94; border-radius: 6px; font-size: var(--fs-body); }
.sw-set h4 { margin: 0; font-size: var(--fs-strong); }
.sw-setrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sw-setrow > span:first-child { width: 150px; flex: none; font-weight: 700; }
.sw-setrow select { padding: 1px 3px; border: 1px solid #464262; border-radius: 4px; background: #ecebf2; color: var(--gf-ink); font-size: var(--fs-body); }
.sw-setrow input[type="range"] { width: 180px; }
.sw-modes { display: flex; gap: 6px; flex-wrap: wrap; }
.sw-mode { display: flex; flex-direction: column; gap: 2px; width: 150px; padding: 5px 7px; border: 2px solid #716c94; border-radius: 5px; background: #ecebf2; color: var(--gf-ink); cursor: pointer; text-align: left; }
.sw-mode.on { border-color: #5f7cff; background: #dbe2fb; box-shadow: 0 0 0 1px #5f7cff; }
.sw-mode b { font-size: var(--fs-body); } .sw-mode i { font-size: var(--fs-caption); font-style: normal; color: #4a4663; }

