/* fixed vertical metrics: the file's hhea / typo metrics disagree, so Chrome and Firefox placed the text at different heights;
   these center capitals in the line box in every browser (cap height 70%: 95% - 70% = 25%), lines stay 1.2em at line-height normal */

/* ====================================================================== */
/* Font                                                                   */
/* ====================================================================== */

@font-face {
	font-family: "Nocturne";
	src: url("../images/NocturneSerif-Regular.woff2") format("woff2");
	font-weight: normal;
	font-style: normal;
	font-display: block;
	ascent-override: 95%;
	descent-override: 25%;
	line-gap-override: 0%;
}

/* ====================================================================== */
/* Design tokens (colors, glows, viewport unit)                           */
/* ====================================================================== */

:root {
	--heat: 46, 160, 90;
	box-sizing: border-box;
	padding-top: env(safe-area-inset-top, 0px);
	padding-bottom: env(safe-area-inset-bottom, 0px);
	--bg: url(../images/tileBg2.webp) #05171b;
	--bgT: url(../images/tileBg3.webp);
	--fg: #ecebf3;
	--bCol: #c3c2ca;
	--mid: #c5c3d1;
	--lighter: #ece6d6;
	--mut: #acaab9;
	--card: #173f408e;
	--card2: #15282e;
	--line: #383d38;
	--line2: #313f4180;
	--hi: #1d3b2e86;
	--sel: #3d3f3385;
	--text: #ffe8c4;
	--textDark: #bead91;
	--acc: #ffe8c4;
	--boxLine: #484e44;
	--thickShadow:
		-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000,
		-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
	--glow: 0 0 2px #cab99d, 0 0 5px #cab99d, 0 0 10px #cab99d, 0 0 20px #cab99d;
	--smallGlow: 0 0 2px #cab99d, 0 0 4px #cab99d, 0 0 5px #cab99d;
	--weakGlow: 0 0 5px #cab99d, 0 0 15px #cab99d;
	--glowBox: drop-shadow(0 0 2px #e0c18fed);
	--minW: 800px;
	--vw: calc(max(100vw, var(--minW)) / 100);


	/* Surfaces: page, panels and modals */
	--surface-page: #05171b;
	--surface-panel-dark: #091b1e;
	--surface-modal: #142324;
	--surface-drop-overlay: rgba(20, 35, 36, 0.85);
	--surface-inset: #0b1416;
	--surface-thumbnail: #0c1416;
	--surface-suggest: #11222a;
	--surface-picker: #121b1e;
	--surface-map-shot: #14282e;
	--surface-picture: #1c2d30;
	--surface-location-find: #25424d85;
	--surface-location-view: #192d34;
	--surface-quest-box: #15292e;
	--surface-quest-hub: #1f3044;
	--surface-quest-tab: rgba(20, 38, 42, .7);
	--surface-quest-tab-hover: rgba(38, 60, 64, .8);
	--surface-quest-selected: #3a4640;
	--surface-quest-map: #cdc5a8;

	/* Surfaces: controls, chips and states */
	--surface-control: #192d34;
	--surface-stat-chip: #192d34c7;
	--surface-control-active: #3b453a;
	--surface-control-activeTransparent: #83743c44;
	--surface-tab-open: #60593e5c;
	--surface-icon-tile: #27444e59;
	--surface-icon-tile-hover: #4874857c;
	--surface-search-focus: #2b2b2b;
	--surface-close: #3a1d1d;
	--surface-close-hover: #4d2424;
	--surface-row-hover: rgba(255, 255, 255, 0.04);
	--surface-boon-bane-chip: #f1efe6;
	--surface-gift-suggestion: #855c0026;
	--surface-boon-filter-on: #5a4a12;
	--surface-boon-tint: rgba(255, 217, 0, 0.08);
	--surface-danger: rgba(229, 72, 77, 0.16);
	--surface-wrong-path: rgba(255, 0, 0, 0.3);
	--surface-repair: rgba(255, 213, 154, 0.1);
	--surface-pulse: rgba(255, 213, 154, 0.16);

	/* Borders */
	--border-control: #39484f;
	--border-stat-chip: #39484fc4;
	--border-control-active: #60593e;
	--border-icon-tile: #3c4d5080;
	--border-quest-panel: #33413f;
	--border-quest-row: #3c4a49;
	--border-quest-box: #605c4d;
	--border-quest-selected: #a99a6c;
	--border-repair: #8a7440;
	--border-path-box: rgba(200, 165, 42, 0.45);

	/* Text: interface */
	--text-control-active: #fff4d9;
	--text-disclaimer: #848691;
	--text-stat-label: #c1b197;
	--text-faded: #cacaca;
	--text-plan-marker: #f1f1f1;
	--text-selection: #ffffff;
	--text-stat-raised: #f3cc4b;
	--text-stat-lowered: #8b80ff;
	--text-upgrade: #9fe0a0;
	--text-gold: #feedd3;
	--text-gift-positive: #5edc7a;
	--text-gift-negative: #e2554f;
	--text-dislike-note: #ff4747;
	--text-danger: #e5484d;
	--text-warning: #e9b86d;
	--text-shop-ok: #9fd49f;
	--text-boon-chip: #b8860b;
	--text-bane-chip: #1e3a8a;
	--text-pair-mark: #f0b9c4;

	/* Text: calendar */
	--text-cal-event: #a9d7c5;
	--text-cal-birthday: #c9b6ee;
	--text-cal-battle: #f0a7a0;
	--text-cal-story: #e7d9b4;

	/* Text: quests */
	--text-quest-body: #f1ece0;
	--text-quest-row: #d9d4c6;
	--text-quest-hub-note: #d9d3c2;
	--text-quest-hub-key: #b9b2a0;
	--text-quest-hit: #e6dcc0;
	--text-quest-good: #b9e0a4;
	--text-quest-giver: #cfc6b0;

	/* Accents */
	--accent-boon: #e3cf9b;
	--accent-bane: #b8c2c8;
	--accent-repair: #ffd59a;
	--accent-gold: #c8a52a;
	--accent-quest: #d8c48e;
	--accent-quest-goal: #f0b53a;
	--accent-quest-giver: #6fc2f0;
	--icon-stat: #a59878;
	--scrollbar-thumb: #8a7f6c;
	--stroke-location-lines: #f2e6b8;
	--selection-bg: #3390ff;

	/* Glows and shadows */
	--glow-warm: #cab99d;
	--glow-marker-on: #e0c18f;
	--glow-marker-hit: #c30000;
	--glow-marker-off: #9a9a9a;
	--glow-marker-off-halo: rgba(160, 160, 160, 0.6);
	--glow-boon-text: rgba(227, 207, 155, 0.4);
	--glow-boon-text-soft: rgba(227, 207, 155, 0.2);
	--glow-boon-line: rgba(227, 207, 155, 0.35);
	--glow-quest-tab-selected: rgba(216, 196, 142, .55);
	--glow-quest-row-selected: rgba(169, 154, 108, .35);
	--glow-quest-goal: #f0b53a99;
	--glow-quest-goal-rim: #ffffff66;
	--glow-quest-giver: #6fc2f099;
	--glow-quest-giver-rim: #ffffff88;
	--glow-pulse: rgba(255, 213, 154, 0.35);
	--glow-item-row: rgba(212, 175, 55, 0.05);
	--shadow-quest-map: rgba(10, 20, 22, .55);
	--shadow-frame: #0a15178a;

	/* Gambit area grid (affected tiles and origin) */
	--gambit-area-fill: rgba(255, 16, 16, 0.8);
	--gambit-area-border: rgba(255, 148, 148, 0.8);
	--gambit-support-fill: rgba(133, 255, 63, 0.8);
	--gambit-support-border: rgba(199, 255, 185, 0.8);
	--gambit-defense-fill: rgba(63, 63, 255, 0.8);
	--gambit-defense-border: rgba(123, 123, 255, 0.8);
	--gambit-origin-fill: rgba(255, 255, 255, 1);
}

/* ====================================================================== */
/* Base: links, scrollbars, html / body                                   */
/* ====================================================================== */

a.pk:hover,
.tierLinks button.pk:hover {
	text-shadow: var(--glow);
}

.sizer {
	min-width: var(--minW);
}

* {
	scrollbar-color: var(--scrollbar-thumb) transparent;
	scrollbar-width: thin;
}

html {
	scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
	font-family: "Nocturne", serif;
	margin: 0;
	color: var(--text);
  --bodyShadow: -1px -1px 0 #0000007a,
		1px -1px 0 #0000007a,
		-1px 1px 0 #0000007a,
		1px 1px 0 #0000007a;
	text-shadow: var(--bodyShadow);
	background-color: black;
	font-size: 15px;
	line-height: normal;
}

a, button {
	color: var(--text);
}

button {
    font: inherit;
}

@media (pointer: coarse) {
	body {
		height: 2000px;
	}
}

.tn > img {
	width: 38px;
	margin: -8px;
	margin-right: 0;
	margin-bottom: 0px;
}

/* ====================================================================== */
/* Typography & text helpers                                              */
/* ====================================================================== */

h1 {
	font-size: 1.2em;
	font-weight: normal;
	margin: 0;
	margin-left: 1em;
	margin-bottom: 4px;
}

.idForge {
	width: 100%;
	font-size: 14px;
}
.idForge th,
.idForge td {
	padding: 2px 4px;
	border-color: var(--line2);
    border-left: 0;
    border-right: 0;
}
.idForge td.idUp {
	color: var(--text-upgrade);
}
.idForge tr.idCur {
	background: var(--sel);
}
.idForge .l {
	text-align: left;
	white-space: normal;
}

small,
.ldNote,
#disclaimer {
	white-space: pre-line;
	font-size: 92%;
	line-height: normal;
}

small small,
small .srcK {
	font-size: 1em;
}

p.m,
small,
.idText,
#disclaimer {
	color: var(--mut);
}

p.m {
	margin: 0 0 10px;
	display: none;
}

/* ====================================================================== */
/* Page layout: card grid, character card                                 */
/* ====================================================================== */

.grid2 {
	width: calc(30.1 * var(--vw));
	display: inline-block;
	flex-shrink: 0;
	max-height: 100%;
	padding-right: 10px;
	box-sizing: border-box;
	padding-left: calc(1 * var(--vw));
}

.grid2 > *:first-child {
	padding-bottom: 0;
}

/* the notice at the bottom of the column when it doesn't scroll, at the end of its contents when it does */
.grid2 {
	display: flex;
	flex-direction: column;
}

.grid2 > * {
	flex-shrink: 0;
}

.grid2 > #disclaimer {
	margin-top: auto;
	padding-bottom: 10px;
}

#mainWrapper {
	position: relative;
}

/* the other tabs: the same, in the .tabContainer */
.tabContainer {
	display: flex;
	flex-direction: column;
	min-height: 100%;
}

.tabContainer > * {
	flex-shrink: 0;
}

.tabContainer > #disclaimer {
	margin-top: auto;
}

.card {
	padding: 10px 8px;
}

.card.pc .row {
	position: relative;
	z-index: 2;
}

.tierLic {
	font-weight: bold;
}

.tierLic .si {
    margin-right: 4px;
}

/* the character card's background: the symbol of the character's faction (app.js: --faction), faint, behind everything on the card */
.card.pc::before {
    content: "";
    position: absolute;
    /* a square as tall as the card, where the symbol was (72% across: left 72%, then back by 72% of its own width), so the mask (ClanMask.png, square) fits it */
    top: 0;
    height: 100%;
    aspect-ratio: 1;
    left: 72%;
    transform: translateX(-72%);
    background: var(--faction, none) center / contain no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    opacity: 0.7;
    pointer-events: none;
    z-index: 0;
    filter: brightness(0.45);
	-webkit-mask-image: url(../images/ClanMask.webp);
    mask-image: url(../images/ClanMask.webp);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

.card .bt {
	padding: calc(0.4 * var(--vw)) calc(0.8 * var(--vw));
}

/* ====================================================================== */
/* Form controls & tables                                                 */
/* ====================================================================== */

select,
input {
	width: 100%;
	box-sizing: border-box;
	padding: 6px;
	border: 1px solid var(--line);
	background: var(--bg);
	color: var(--fg);
	font: inherit;
}
[hidden] {
	display: none !important;
}

table {
	border-collapse: collapse;
	width: 100%;
}

th,
td {
	border: 1px solid var(--line);
	padding: 4px 8px;
	text-align: center;
	white-space: nowrap;
}

.movText {
	color: var(--text-stat-label);
	font-size: 0.92em;
	display: inline-block;
	margin-right: 0.5em;
}

/* the labels in the stat rows (Bld beside HP, the combat stats): no taller than the line, or the row grows and the rows under it sit lower */
#gt td .movText,
#gt2 td .movText {
	line-height: 1;
}

/* ====================================================================== */
/* Character sheet: growth table, spider chart, recruit list              */
/* ====================================================================== */

/* a wrapper that only carries data-nosnippet (Google reads it on span, div and section only, not on a table): no box of its own, the table lays out as before */
.nsWrap { display: contents; }
#gt {
	position: absolute;
	left: 7.85%;
	top: calc(22.2 * var(--vw));
	font-size: calc(1.25 * var(--vw));
	line-height: 180%;
	width: auto;
}

.builder #gt,
.builder #gt2 {
	z-index: 1;
	z-index: 1;
}

#gt td,
#gt2 td {
	padding: 0;
	border: 0 solid transparent;
	text-align: right;
	white-space: nowrap;
	border-right-width: calc(2.2 * var(--vw));
	border-bottom-width: calc(0.46 * var(--vw));
	box-sizing: content-box;
	width: calc(6.7 * var(--vw));
	cursor: pointer;
}
.spider-chart-container {
	position: absolute;
	left: 24.4%;
	top: calc(22.6 * var(--vw));
	width: 9.35%;
	aspect-ratio: 1 / 1;
	line-height: 0;
}

/* the combat stats' chart (app.js renderCombatSpider): under the stats' one, as #gt2 is under #gt (39 - 22.2 vw lower) */
.spider-chart-container.spider2 {
    top: calc(38.87 * var(--vw));
}
.spider-chart-container.spider2[hidden] {
	display: none;
}

/* the Builder button (index.html #bdb, styled as Create a build: .pk.bcCreate): under the spider chart, as wide */
#bdb {
    position: absolute;
    left: 24.8%;
    top: calc(33 * var(--vw));
    width: 8.8%;
    box-sizing: border-box;
    text-align: center;
    z-index: 2;
	height: auto;
	aspect-ratio: 5 / 1; /* (at least a third of its width tall; taller when its text needs it: min-height auto) */
    font-size: 16px;
	display: flex;
    align-items: center;
    justify-content: center;
	padding-top: 4px;
	padding-bottom: 4px;
}

.lrs .lr,
.idSec .lr {
    height: 2em;
    aspect-ratio: 1.25 / 1;
	margin: 1px 3px;
	vertical-align: middle;
}

.recruitContainer {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
}

.recruitContainer > span {
	flex-basis: 17em;
	max-width: calc(33% - 5px);
	margin: 0;
}

.rgFast .recruitContainer > span {
    max-width: calc(50% - 5px);
}
/* (a character in the recruitment lists: the game's gold title rule under the name line (the name and its support heart), across the tile, as the Recruitment tab's cards) */
.recruitContainer .rcCont { flex: 1; min-width: 0; }
.recruitContainer .rcCont > small:first-of-type {
	display: block;
	margin-top: 1px;
	padding-top: 5px;
	background: url("../images/ui/prf-rule.webp") left top / auto 4px repeat-x;
}

/* the combat stats under the stats (app.js renderCombatStats: the builder and build tabs): Phys / Mys, Prt, AS, Rsl, Hit, Avo, Crit, Ddg */
#gt2 {
	position: absolute;
	left: 7.85%;
	top: calc(38.5 * var(--vw));
	font-size: calc(1.25 * var(--vw));
	line-height: 180%;
	width: auto;
}
#gt2[hidden] {
	display: none;
}

td#g-total {
	position: absolute;
	top: calc(-2.7 * var(--vw));
	left: calc(8.9 * var(--vw));
}

div#abil {
	padding-bottom: 0;
}

summary::marker {
	margin-right: 4px;
}

/* an info link (app.js infoLink): the label with an info icon, as a link; open, the text under it (also an <a>: it opens a list) */
a.infoLink,
.infoLink > summary {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	list-style: none;
	cursor: pointer;
	color: var(--text);
	text-decoration: underline dotted;
	text-underline-offset: 2px;
	font-size: 0.92em;
}

.infoLink > summary::-webkit-details-marker {
	display: none;
}
.infoLink > summary:hover,
a.infoLink:hover,
a.infoLink:focus-visible,
.infoLink > summary:focus-visible {
	text-shadow: var(--smallGlow);
}

details.infoLink:open {
    margin-bottom: 8px;
}

.infoLink .infoIc {
	width: 1.1em;
	height: 1.1em;
	flex-shrink: 0;
}
.infoLink[open] > summary {
	margin-bottom: 2px;
}

#gt td:empty,
#gt2 td:empty {
	display: none;
}

td.l {
	text-align: left;
}

td.pl {
	white-space: normal;
	max-width: calc(30vw);
}

td.d {
	color: var(--mut);
}
td.bb {
	background: var(--hi);
}
td select {
	padding: 3px;
	min-width: 80px;
}
.ok {
	color: var(--text);
}

/* ====================================================================== */
/* Skill lists & popup links (.arrowLink, .skItem)                        */
/* ====================================================================== */

.sk {
	margin: 0.8em 2px;
	margin-bottom: 1em;
}
.sk.nr {
	background: var(--surface-danger);
	border-color: var(--text-danger);
	color: var(--text-danger);
}
.sk.nr .rk {
	color: var(--text-danger);
}
.sh {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
	align-items: center;
	justify-content: space-between;
}
.sh select {
	width: auto;
	min-width: 90px;
}
select.bb {
	background: var(--hi);
	color: var(--fg);
}

.sk ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.searchIcon {
	display: flex;
	margin-left: auto;
}

.searchIcon svg {
	width: 1em;
	margin-right: 0.5em;
}

.sk li {
	display: flex;
    flex-direction: column;
	border-bottom: 1px solid var(--line);
}

.sk li summary {
	padding: 0.3em 0;
}

/* links to the item popup that stand in for expandable rows: same arrow as a summary */
.arrowLink {
	display: list-item;
	list-style: disclosure-closed inside;
	white-space: normal;
	padding-top: 1px;
	padding-bottom: 1px;
	width: fit-content;
}

small a.arrowLink {
	text-decoration: underline dotted; /* like small details summary */
}
/* a popup link that starts with an icon (a weapon's combat art, the weapons with an art): icon first, then the arrow */
.arrowLink > :is(img, .sw):first-child {
	float: left;
}
/* ...or the icon alone, no arrow (a weapon's combat art in the weapon tables, the weapons with an art) */
.arrowLink.noArrow {
	list-style: none;
}

.pl .skItem.arrowLink .si {
	margin-right: 0;
}

/* a popup link with no icon of its own: an info badge (a circled i, like the rank badges) instead of the arrow */
a.arrowLink:not(:has(img, .sw, .si, .rk)) {
	list-style: none;
	text-decoration-style: dotted; /* where these links are underlined (small text) */
	text-underline-offset: 0.15em;
}
a.arrowLink:not(:has(img, .sw, .si, .rk))::before {
	content: "i";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 1.125em;
	height: 1.125em;
	margin-right: 4px;
	border: 1px solid currentColor;
	border-radius: 50%;
	font-size: 0.92em;
	font-weight: bold;
	vertical-align: 0.1em;
	vertical-align: text-bottom;
}

.arrowLink:not(:first-child):not(.skItem),
.acqLoc:not(:first-child):not(.acqInline > .acqLoc) {
	padding-top: 2px;
}
/* combat arts and blaze skills in the character's skill lists: the whole row opens the popup */
.sk li a.skItem {
	flex: 1;
	padding: 0.3em 0;
}
.sk li a.skItem > .sw {
	float: left; /* like summary>.sw: icon first, then the arrow */
	margin-right: 4px;
}
/* the combat art / ability icon after the arrow: 1px up, centred on the name */
.sk li a.skItem > img.si {
	vertical-align: text-bottom;
}

.dk img {
	filter: hue-rotate(220deg) contrast(1.5);
}

.dkI {
	filter: hue-rotate(235deg) contrast(1.4) saturate(1.8);
}

.sk li .rk {
	margin-right: 6px;
	margin-left: 2px;
}

.sk li .lrt .rk {
	vertical-align: middle;
}

/* ====================================================================== */
/* Icons, rank badges, chips                                              */
/* ====================================================================== */

/* a rank (app.js renderRankBadge): the game's rank icon (IconMasteryLv_*, white; images/ranks/) as a mask (.rkG) filled with the rank's colour,
   the size of the icon (.si) it sits next to */
.rk {
	flex: none;
	display: inline-block;
	width: 1.2em;
	height: 1.2em;
	vertical-align: text-bottom;
	color: var(--text);
}
/* (.rkG is 2px bigger than .rk on every side, the mask the size of .rk in its middle: under the main UI's transform scale its box edge rounds, and a mask
   reaching the edge lost its left pixel) */
.rkG { display: block; width: calc(100% + 4px); height: calc(100% + 4px); margin: -2px; background-color: currentColor; -webkit-mask: center / calc(100% - 4px) calc(100% - 4px) no-repeat; mask: center / calc(100% - 4px) calc(100% - 4px) no-repeat; }
.rkE { -webkit-mask-image: url(../images/ranks/e.png); mask-image: url(../images/ranks/e.png); }
.rkEp { -webkit-mask-image: url(../images/ranks/e-plus.png); mask-image: url(../images/ranks/e-plus.png); }
.rkD { -webkit-mask-image: url(../images/ranks/d.png); mask-image: url(../images/ranks/d.png); }
.rkDp { -webkit-mask-image: url(../images/ranks/d-plus.png); mask-image: url(../images/ranks/d-plus.png); }
.rkC { -webkit-mask-image: url(../images/ranks/c.png); mask-image: url(../images/ranks/c.png); }
.rkCp { -webkit-mask-image: url(../images/ranks/c-plus.png); mask-image: url(../images/ranks/c-plus.png); }
.rkB { -webkit-mask-image: url(../images/ranks/b.png); mask-image: url(../images/ranks/b.png); }
.rkBp { -webkit-mask-image: url(../images/ranks/b-plus.png); mask-image: url(../images/ranks/b-plus.png); }
.rkA { -webkit-mask-image: url(../images/ranks/a.png); mask-image: url(../images/ranks/a.png); }
.rkAp { -webkit-mask-image: url(../images/ranks/a-plus.png); mask-image: url(../images/ranks/a-plus.png); }
.rkS { -webkit-mask-image: url(../images/ranks/s.png); mask-image: url(../images/ranks/s.png); }
.rkSp { -webkit-mask-image: url(../images/ranks/s-plus.png); mask-image: url(../images/ranks/s-plus.png); }
/* (no rank: a narrow gap) */
.rk:empty { visibility: hidden; width: 3px; }
.rk.rkQuest img { display: block; width: 100%; height: 100%; margin: 0; object-fit: contain; } /* (learned in a quest: its type's icon in the place of the rank) */
/* (next to a bigger icon: its size) */
.ln .rk, .idWeapon .rk { width: 20px; height: 20px; }
.idSec.idSec-skills .rk { width: 1.5em; height: 1.5em; }
.idSec.idSec-stats {
    clear: both;
}

.mountName {
	white-space: nowrap;
}


.art-skill {
	text-align: right;
}

.skill > *,
.art-skill > *,
.requirementsWrapper > *,
.smallRequirements > * {
	vertical-align: text-bottom;
}

#md .mTabList a .si,
.modalWa .mTabList a .si,
.modalWc .mTabList a .si,
.modalWt .mTabList a .si {
    border-radius: 50%;
}

:is(#cmn, #mtb) .pk.tabIc {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
:is(#cmn, #mtb) .pk.tabIc .si {
	height: 1.1em;
	width: 1.1em;
	margin: 0;
	object-fit: contain;
	margin-left: -0.3em;
}

.si {
	height: 1.2em;
	width: 1.2em;
	vertical-align: text-bottom;
}

.pl .si,
.arrowLink .si,
.giftContainer .si {
	margin-right: 6px;
}

.ln .si {
	height: 20px;
}

.chp {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	margin: 2px 4px;
	vertical-align: middle;
}

.chp .si {
    margin-right: 0;
}

.idSec .acqFull .loc {
    color: var(--mut);
}

.sw {
	position: relative;
	flex: none;
	display: inline-flex;
}

.bn {
	position: absolute;
	right: 0px;
	top: 0px;
	background: rgba(0, 0, 0, 0.67);
	color: var(--text);
	font-style: normal;
	font-size: max(6px, 0.6vw);
	font-weight: 700;
	border-radius: 50%;
	z-index: 1;
	aspect-ratio: 1;
	border: 1px solid var(--text);
	width: 1.67em;
	line-height: 1.67em;
	text-align: center;
}

/* ====================================================================== */
/* Skill list headers (boon / bane)                                       */
/* ====================================================================== */

/* learned skill list header: skill icon (boon / bane) + name */
/* name in spaced small caps, then a line fading out to the right; --hc is the header colour: boon gold (glowing), bane blue,
   neutral the normal text */
.skHead {
	--hc: var(--textDark);
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 4px 0 6px;
	margin-bottom: 2px;
	padding-bottom: 0;
}
.skHead .si {
	height: 1.35em;
	width: 1.35em;
}
.skHead b {
	color: var(--hc);
	font-variant: small-caps;
	letter-spacing: 0.08em;
	font-size: 1.08em;
	white-space: nowrap;
}

/*.skHead::after {
	content: "";
	flex: 1;
	height: 1px;
	margin-left: 4px;
	background: linear-gradient(to right, var(--hc), transparent);
	opacity: 0.45;
}*/

.skHead.boonH {
	--hc: var(--accent-boon);
}

.boonH li .rk {
	color: var(--accent-boon);
}

.baneH li .rk {
	color: var(--accent-bane);
}

.skHead.boonH b {
	text-shadow:
		0 0 4px var(--glow-boon-text),
		0 0 8px var(--glow-boon-text-soft);
}
.skHead.boonH::after {
	opacity: 0.7;
	box-shadow: 0 0 4px var(--glow-boon-line);
}
.skHead.baneH {
	--hc: var(--accent-bane);
}

.idChip .lmItem {
	overflow: visible;
}

.li0 {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 0;
}

.sk li {
	align-items: flex-start;
}

.sk li:first-child a {
	padding-top: 0;
}

.br {
	flex-basis: 100%;
	height: 0;
}

.ds {
	white-space: pre-line;
}

summary {
	cursor: pointer;
}

.st {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	color: var(--mut);
}
.st b {
	color: var(--fg);
}
.boon,
.bane {
	padding: 1px 8px;
	background: var(--surface-boon-bane-chip);
}
.boon {
	color: var(--text-boon-chip);
}
.bane {
	color: var(--text-bane-chip);
}

/* ====================================================================== */
/* Rows & ability boxes                                                   */
/* ====================================================================== */

.row {
	padding-left: 10px;
	font-size: max(12px, min(1em, calc(1.25 * var(--vw))));
	line-height: normal;
}

.row:not(:first-child) {
    filter: drop-shadow(0 0 1px black);
}

.row:first-child {
	padding-left: 0;
	font-size: calc(2 * var(--vw));
	line-height: 120%;
}

.row:first-child button {
	text-shadow:
		var(--thickShadow),
		0 0 2px var(--glow-warm),
		0 0 5px var(--glow-warm),
		0 0 10px var(--glow-warm),
		0 0 20px var(--glow-warm);
    width: 100%;
}

.row small {
	white-space: pre-line;
	display: inline-block;
}

.abilityDescription {
	display: block;
	padding-bottom: 2px;
}

.abilityDescription:not(.abilityDescription ~ .abilityDescription) {
	margin-top: 2px;
}

.abilityDescription:last-child {
	margin-bottom: 8px;
	border-bottom: 1px solid var(--line);
}

.namedAbility:last-child .abilityDescription {
	margin-bottom: 0;
}

.ab .sk {
    padding: 0;
    margin: 0;
}

.ab .st {
	margin-top: 0;
}

.ab {
	margin: 8px 0;
	margin-bottom: 16px;
}

.ab .lmItem {
    vertical-align: baseline;
}

.abGrp:first-child>.ab {
    margin-top: 4px;
}

.bcCols .abGrp:first-child>.ab {
    margin-top: 8px;
}

.sk:nth-child(2) {
    margin-top: 10px;
}

/* ability icons in the ability boxes (ability, equippable, class mastery / inherent, mount): 4px before the name */
.ab img.si {
	margin-right: 4px;
	vertical-align: text-bottom;
}
/* class inherent abilities: one per line, the description below the name */
.ab .abLine {
	margin-top: 6px;
}

/* ====================================================================== */
/* Buttons & modal frame (.pk, .mb, .mh)                                  */
/* ====================================================================== */

.pk {
	box-sizing: border-box;
	padding: 0.4vw 1vw;
	color: var(--text);
	font: inherit;
	text-align: left;
	cursor: pointer;
	background: transparent;
	border: 0;
	pointer-events: all;
}

#md {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 9;
	display: flex;
	padding: 0;
	box-sizing: border-box;
}

.mountHeader,
.likedFood {
	width: 1px;
	padding-left: 2px;
	padding-right: 2px;
	min-width: auto !important;
}

.mountName {
	padding-right: 2px;
}

.likedFood .si {
	height: 1.4em;
	width: 1.4em;
}

.likedTaste {
	padding-left: 2px;
	padding-right: 2px;
}

.mountHeader .mi {
	margin: 0 !important;
}

.mb {
	background: var(--surface-modal);
	background-image: url(../images/listCenter2.webp);
	background-position: center center;
	width: 100%;
	max-width: 100%;
    height: auto;
	max-height: 100%;
	background-size: 100%;
	display: flex;
	flex-direction: column;
	position: relative;
	box-sizing: border-box;
}

#md .mb {
	width: auto;
	min-width: min(100%, 1220px);
	height: fit-content;
}

#cmp .mb {
	height: 100%;
}

.rcCont svg {
	vertical-align: middle;
}

.mb > * {
	z-index: 1;
	position: relative;
}

.divider {
	background-image: url(../images/dividerT.webp);
    filter: drop-shadow(1px 1px 0px var(--shadow-frame));
	height: 4px;
    background-size: cover;
    margin-top: 2px;
    margin-bottom: 6px;
}

.calcTitle {
	margin-left: 1em;
	color: var(--textDark);
    font-variant: small-caps;
    letter-spacing: 0.08em;
    font-size: 1.08em;
	font-weight: bold;
}

.calcTitle small {
    padding-left: 3em;
}

.ab .idGrowth {
	margin: 0;
	padding-bottom: 4px;
	border-bottom: 1px solid var(--line);
}

/* the looking glass of the search fields (and the Ability finder's field, .finderIc) */
:root {
	--searchGlass: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 122.879 119.799' fill='%23757575'%3E%3Cpath d='M49.988,0h0.016v0.007C63.803,0.011,76.298,5.608,85.34,14.652c9.027,9.031,14.619,21.515,14.628,35.303h0.007v0.033v0.04 h-0.007c-0.005,5.557-0.917,10.905-2.594,15.892c-0.281,0.837-0.575,1.641-0.877,2.409v0.007c-1.446,3.66-3.315,7.12-5.547,10.307 l29.082,26.139l0.018,0.016l0.157,0.146l0.011,0.011c1.642,1.563,2.536,3.656,2.649,5.78c0.11,2.1-0.543,4.248-1.979,5.971 l-0.011,0.016l-0.175,0.203l-0.035,0.035l-0.146,0.16l-0.016,0.021c-1.565,1.642-3.654,2.534-5.78,2.646 c-2.097,0.111-4.247-0.54-5.971-1.978l-0.015-0.011l-0.204-0.175l-0.029-0.024L78.761,90.865c-0.88,0.62-1.778,1.209-2.687,1.765 c-1.233,0.755-2.51,1.466-3.813,2.115c-6.699,3.342-14.269,5.222-22.272,5.222v0.007h-0.016v-0.007 c-13.799-0.004-26.296-5.601-35.338-14.645C5.605,76.291,0.016,63.805,0.007,50.021H0v-0.033v-0.016h0.007 c0.004-13.799,5.601-26.296,14.645-35.338C23.683,5.608,36.167,0.016,49.955,0.007V0H49.988L49.988,0z M50.004,11.21v0.007h-0.016 h-0.033V11.21c-10.686,0.007-20.372,4.35-27.384,11.359C15.56,29.578,11.213,39.274,11.21,49.973h0.007v0.016v0.033H11.21 c0.007,10.686,4.347,20.367,11.359,27.381c7.009,7.012,16.705,11.359,27.403,11.361v-0.007h0.016h0.033v0.007 c10.686-0.007,20.368-4.348,27.382-11.359c7.011-7.009,11.358-16.702,11.36-27.4h-0.006v-0.016v-0.033h0.006 c-0.006-10.686-4.35-20.372-11.358-27.384C70.396,15.56,60.703,11.213,50.004,11.21L50.004,11.21z'/%3E%3C/svg%3E");
}

input[type="search"] {
	max-width: 250px;
	min-width: 150px;
	background-image: var(--searchGlass);
	background-size: 1em;
	background-position: 0.3em center;
	background-repeat: no-repeat;
	padding-left: 1.55em !important;
    text-overflow: ellipsis;
	position: relative;
}
/* WebKit keeps room for the clear button even when it is hidden, so the placeholder was cut off before the box's edge: the button is taken out of the
   line (absolute, at the right edge), with room for it only when there is text */
input[type="search"]::-webkit-search-cancel-button {
	position: absolute;
	right: 0.4em;
	top: 50%;
	margin: 0;
	transform: translateY(-50%);
}
input[type="search"] {
	padding-right: 1.8em !important;
}

input[type="search"]:placeholder-shown {
	padding-right: 0.2em !important;
}

.mh,
#spp .mh {
    --tabH: 40px;
    --mhLine: 60px;
    display: flex;
    gap: 4px;
    align-items: center;
    min-height: 60px;
    flex-shrink: 0;
    padding-bottom: 10px;
    padding-top: 10px;
    box-sizing: border-box;
    padding-left: 16px;
    padding-right: 16px;
    position: relative;
    margin-bottom: -2px;
    z-index: 2;
}

.mainWrapper a.lmItem {
	white-space: normal !important;
}

.noRecruitPath .rt {
	filter: grayscale(1) brightness(0.7) contrast(1.5);
}

.noRecruitPath .bt {
	color: var(--mut);
}

.mh input {
	flex: 1;
}
.mh .pk {
	width: auto;
}

.mountSelectionGrowth {
	width: calc(100% + 8px);
	margin: 0px -4px;
}

.mountSelectionGrowth tr {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
}

.mountSelectionGrowth td {
	border: 0;
	color: var(--text);
}

/* ====================================================================== */
/* Tiles & pickers (.tg, .tile, .im)                                      */
/* ====================================================================== */

.tg {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 6px;
}
.tg.w {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 21em), 1fr));
}

.mountSelectionGrowth .class-growth:empty {
    display: none;
}

.tg.tgbt {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20em), 1fr));
}

.tilebt .idArea {
    float: right;
    margin-left: 6px;
}

.wrap {
	margin: auto;
	position: relative;
	line-height: normal;
	flex-grow: 1;
	transform-origin: center top;
	top: 50%;
	transform: translate(0, -50%);
}

.tile {
	padding: 6px;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	font-size: 16px;
	line-height: normal;
}

.tg:not(.w) .tile {
	text-align: center;
	padding: 0;
}

/* character picker: the faction symbol behind the character (app.js renderClassTileHtml: --faction), in the look of the card's (.card.pc::before) */
.tilech {
	isolation: isolate;
}
.tile .tFaction {
	position: absolute;
	inset: 0;
	background: var(--faction, none) left top / auto 100% no-repeat;
	transform: translate(-20%, -20%);
	opacity: 0.8;
	filter: brightness(0.4);
	pointer-events: none;
	z-index: -1;
	-webkit-mask-image: url(../images/ClanMask.webp);
    mask-image: url(../images/ClanMask.webp);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

/* character picker: the character's boons in the bottom right of the tile */
.tile .tBoon {
	position: absolute;
	right: 2px;
	bottom: 2px;
	display: flex;
	gap: 1px;
	pointer-events: none;
	flex-wrap: wrap;
    flex-wrap: wrap-reverse;
    justify-content: flex-end;
}
.tile .tBoon .si {
	width: 16px;
	height: 16px;
	margin: 0;
	filter: drop-shadow(0 0 2px #000);
}

.displayNone {
	display: none !important;
}

.tg:not(.w) .tile b {
	position: absolute;
	top: 2.5%;
	text-shadow: var(--thickShadow);
	width: 100%;
	left: 0;
}

.tile.sel {
	background: var(--sel);
}

.im {
	width: 100%;
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	margin-top: 10px;
}
.im img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top;
}

.gh {
	margin: 14px 0 6px;
	font-weight: 700;
	color: var(--text);
}
.ln {
	font-size: 14px;
	margin-top: 3px;
	white-space: pre-line;
	color: var(--mut);
}

.tile > small {
	color: var(--mut);
}

/* ====================================================================== */
/* Portrait card & main section background                                */
/* ====================================================================== */

.pc {
	display: flex;
	align-items: flex-start;
	position: absolute;
	left: 6.38%;
	margin: 0;
	padding: 0;
	top: calc(5.96 * var(--vw));
	width: 27.03%;
	height: calc(13.05 * var(--vw));
	overflow: hidden;
    z-index: 2;
}

.pf {
	flex: 1;
	min-width: 0;
	position: relative;
	height: 100%;
	pointer-events: none;
}
.pt {
	flex: none;
	width: calc(12 * var(--vw));
	cursor: pointer;
	position: absolute;
	right: 0;
	bottom: 0;
	height: 97%;
}
.pt .im {
	margin: 0;
	height: 100%;
	border-radius: 0;
}

/* the card's portrait fades out on its left side */
.pt .im img {
	-webkit-mask-image: linear-gradient(to right, transparent, #000 15%);
	mask-image: linear-gradient(to right, transparent, #000 15%);
}

#cmc small:has(> details) + br {
	display: none;
}

summary .si {
	margin-right: 4px;
}

div#lt {
	flex-grow: 1;
	padding: 10px 8px;
	box-sizing: border-box;
	gap: 0.5em;
	padding-top: 0;
	max-height: 100%;
}

section {
	padding-left: 35%;
	padding-top: calc(8.7 * var(--vw));
	padding-right: 2.5%;
	padding-bottom: calc(1.9 * var(--vw));
	background: url(../images/background14.webp);
	background-repeat: no-repeat;
	background-size: 100%;
	position: relative;
	aspect-ratio: 1.85567;
	box-sizing: border-box;
	/* (the card's content, #mainWrapper, fills what is left under the padding as a flex item, not with height: 100%: Safari (WebKit) resolves that 100% against the
	   section's whole aspect-ratio height, padding included, so the content was taller than the frame and the section grew past its picture; min-height: 0 so it
	   keeps its ratio) */
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.tn span:first-child {
	white-space: nowrap;
}

.ds a {
	text-decoration: underline dotted;
	cursor: pointer;
}

.ds small {
	margin-top: 5px;
	display: inline-block;
}

.card > .ab:first-child {
	margin-top: 0.3em;
}

/* ====================================================================== */
/* Tab containers & wrappers                                              */
/* ====================================================================== */

.tabContainer {
	--tcPadR: calc(1 * var(--vw)); /* the tab's right padding: the part that scrolls inside it (.bcMain, .tabMain) takes it as a negative margin and as its own padding, so its scrollbar is at the tab's edge */
}

.tabContainer,
.gridcontainer {
	padding: 10px;
	padding-left: calc(1 * var(--vw));
	padding-right: var(--tcPadR, calc(1 * var(--vw)));
	padding-top: 0;
	position: relative;
	max-height: 100%;
	max-width: 100%;
	box-sizing: border-box;
	width: 100%;
}

.tabContainer:has(.tabMain) {
	padding-bottom: 0;
}

.tabContainer .tabMain {
	padding-bottom: 10px;
}

.tabContainer,
.gridcontainer > * {
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-gutter: stable;
}

.tabContainer > *:first-child {
	padding-top: 0;
	margin-top: 12px;
}

.idForge .ef {
    margin: 0;
    margin-right: 4px;
    vertical-align: text-bottom;
    height: 1.4em;
    width: 1.4em;
    margin-top: -0.2em;
    margin-bottom: -0.2em;
}

.birdWrapper {
	width: fit-content;
}

.tabContainer .birdAnswer:first-child {
    margin-top: 0;
}

.tabContainer .birdAnswer:last-child {
    border-bottom: 0;
}

.tabContainer .birdAnswer {
    padding-left: 8px;
    padding-right: 8px;
    color: var(--fg);
    margin-bottom: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
    margin-top: 8px;
}

.birdAnswer b {
    color: var(--text);
	border: 1px solid var(--line);
	padding: 4px 6px;
	display: inline-block;
	margin-top: 4px;
	font-weight: normal;
    margin-left: 6px;
}

.gridcontainer {
	padding: 0;
	display: flex;
}

#lineCover {
	content: "";
	background-image: url(../images/bgLineCover4.webp);
	background-size: 100%;
	width: 100%;
	height: 100%;
	left: 0;
	top: 0;
	position: absolute;
	pointer-events: none;
}

#basicStats {
	content: "";
	background-image: url(../images/basicStats.webp);
	background-size: 100%;
	width: 100%;
	height: 100%;
	left: 0;
	top: 0;
	position: absolute;
	pointer-events: none;
	background-repeat: no-repeat;
}

/* the combat stats' labels under the stats (app.js renderCombatStats: phys, or mys with a spell equipped) */
#basicStats.phys {
	background-image: url(../images/basicStats.webp), url(../images/combatStats.webp);
}

#basicStats.mys {
	background-image: url(../images/basicStats.webp), url(../images/combatStatsMys.webp);
}

.mainWrapper {
	/*display: flex;*/
	height: 100%;
	flex: 1 1 0; /* (the section's flex column: what is left of its height, see section) */
	min-height: 0;
	width: 100%;
	box-sizing: border-box;
}

.mainWrapper th {
	text-align: left;
}
.mainWrapper th,
.mainWrapper td {
	border-left: 0;
	border-right: 0;
}
.mainWrapper tr:first-of-type th,
.mainWrapper tr:first-of-type td {
	border-top-width: 0;
}
.mainWrapper tr:last-child th,
.mainWrapper tr:last-child td {
	border-bottom-width: 0;
}

/* class picker: allowed-skill icons on the name line, right aligned */
.tn {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
}

.tn .al {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	margin-left: auto;
}

.tn .chp {
	margin: 0 0 0 6px;
}

.sks {
	display: flex;
	flex-wrap: wrap;
	padding: calc(0.5 * var(--vw));
	position: absolute;
	bottom: 0;
}

.noVertPadding {
	padding-top: 0;
	padding-bottom: 0;
}

.ski {
	display: inline-flex;
}

.ski.off {
	filter: brightness(0.4);
}

.ski .si {
    height: max(0.85em, calc(1.4 * var(--vw)));
    width: max(0.85em, calc(1.4 * var(--vw)));
	padding-right: calc(0.5 * var(--vw));
	padding-top: calc(0.5 * var(--vw));
}

.gm {
	color: var(--text-stat-raised);
}

/* the sources of a lowered stat in the tooltip (app.js statBreakdownHtml): blue, as the cell's arrow (td.gm.dn) */
#tip .dn {
	color: var(--text-stat-lowered);
}

#tip {
	position: fixed;
	z-index: 20;
	/* (a solid panel behind the frame picture, 8px in from its edges: the picture's middle is partly see-through; a unit's panel, .euTip, has none) */
	background: linear-gradient(var(--surface-panel-dark), var(--surface-panel-dark)) 8px 8px / calc(100% - 16px) calc(100% - 16px) no-repeat;
	border: 0;
	border-image: url("../images/ui/tip-frame.webp") 41 81 fill / 41px 81px; /* (its edge line 3px in, the shading inside it ~20px) */
	padding: 16px 20px;
	font-size: 14px;
	line-height: 1.35;
	color: #f2ead6;
	filter: drop-shadow(1px 1px 2px black);
}
#tip.up { border-image-source: url("../images/ui/tip-frame-up.webp"); }
#tip::before {
	content: "";
	position: absolute;
	left: var(--tipArrowX, 14px);
	top: -15px; /* (its base's outline row, the texture's row 20, on the window's edge line, 3px in) */
	width: 26px;
	height: 23px;
	background: url("../images/ui/tip-arrow.webp") center / 100% 100% no-repeat;
	pointer-events: none;
}
#tip.up::before { top: auto; bottom: -15px; transform: scaleY(-1); }

#tip hr {
	border: 0;
	border-top: 1px solid var(--line);
	margin: 4px 0;
}

td.gm {
	position: relative;
}

td.gm::after,
.mv.gm::after {
    content: "";
    position: absolute;
    right: calc(-0.8 * var(--vw));
    top: calc(0.8 * var(--vw));
    width: 0;
    height: 0;
    border-left: calc(0.3 * var(--vw)) solid transparent;
    border-right: calc(0.3 * var(--vw)) solid transparent;
    transform: translateY(-50%);
}

td.gm.up::after,
.mv.gm.up::after {
	border-bottom: calc(0.5 * var(--vw)) solid currentColor;
}

td.gm.dn::after {
	border-top: calc(0.5 * var(--vw)) solid currentColor;
}

/* a lowered stat (or growth): blue, the arrow pointing down (the arrow takes the colour: currentColor) */
td.gm.dn {
	color: var(--text-stat-lowered);
}

.mv {
	cursor: pointer; /* (a click shows its breakdown, as the stats: app.js movBreakdownHtml) */
	position: absolute;
	top: calc(19.7 * var(--vw));
	left: calc(28 * var(--vw));
	text-align: right;
	width: calc(5 * var(--vw));
	font-size: calc(1.25 * var(--vw));
	line-height: 150%;
}

.chp .bn {
	font-size: 10px;
	padding: 1px;
	border-width: 1px;
	right: -5px;
	top: -5px;
}

/* ====================================================================== */
/* Card buttons, .bt buttons, .ci icons                                   */
/* ====================================================================== */

.cardButtons {
	position: absolute;
	display: flex;
	/*border: 2px solid var(--line);*/
	border-radius: 0;
	/*background: var(--bgT);*/
	padding: 0;
	width: 61%;
	top: calc(5.95 * var(--vw));
	z-index: 1;
	justify-content: center;
	left: 35%;
	pointer-events: none;
	line-height: calc(2.2 * var(--vw));
	height: calc(2.2 * var(--vw));
	line-height: max(1.4em, calc(2.2 * var(--vw)));
	height: max(1.4em, calc(2.2 * var(--vw)));
	margin-top: min(0px, 2.2 * var(--vw) - 1.4em);
	box-sizing: border-box;
}

.characterName .lr {
	margin-right: 4px;
	margin-top: 1px;
	margin-bottom: 1px;
}

.cardButtons > .pk {
	pointer-events: all;
	flex-grow: 1;
	margin-left: 0;
	margin-right: 0;
	font-size: max(14px, calc(1 * var(--vw)));
	flex-basis: 1%;
	white-space: nowrap;
	border-radius: 0;
	background: none;
	/*border: 2px solid transparent;
    margin: -2px;*/
	border: 0;
	padding-top: 0;
	padding-bottom: 0;
	text-align: center;
	padding-left: 0.4em;
	padding-right: 0.4em;
	text-decoration: none;
	border: 1px solid transparent;
    line-height: unset;
}

.idSec .si {
    margin-right: 4px;
}

.idSec .lr[data-ch] {
    margin-right: 4px;
}

.mountName .lmItem {
	white-space: normal;
}

/* a card's other tabs: the game's menu item not selected (Common_Choice_WdwMenuItem_Default), cut as the open one's below (the same place in the texture: its frame
   where the game draws it, a little in from the open one's; no diamonds) */
/* (the Builder button, #bdb, the same: not in the row, its own height: a line, its 4px padding above and below, its 1px border) */
#bdb { --tabDiamond: calc((1lh + 10px) * 55 / 92); }
/* (the middle piece: from half into one end piece to half into the other, under their solid part, not out past their ends: an end is 100 / 55 a diamond wide) */
/* (no .bt arrow, .bt::before: the tabs are the game's buttons) */
.cardButtons > .pk::before,
#bdb::before { display: none; }
:is(.cardButtons > .pk, #bdb), .pk.gBtn.gBtn, .pk.gBtn.on::after {
	/* (the ends the width the middle leaves them (--bE), not their own at the button's height: a button lower than --gH (a portrait screen's smaller one) had its ends
	   narrower than that, a gap each side of the middle) */
	background: var(--bL) left center / var(--bE) 100% no-repeat, var(--bR) right center / var(--bE) 100% no-repeat,
		var(--bM) center / calc((100% - 2 * var(--bE) + 2px) * var(--bK)) 100% no-repeat;
	background-origin: border-box;
}
:is(.cardButtons > .pk, #bdb) {
	border-color: transparent;
	/* (the middle: a 32 px strip from the picture's centre (tab-m, tab-hover-m, tab-open-m) stretched over the gap, as .gBtn's: the whole 558 px picture squeezed in
	   looked faded in Chrome / Edge, which shrinks it with a copy blurred for its strongest squeeze) */
	--bL: url("../images/ui/tab-l.webp"); --bR: url("../images/ui/tab-r.webp"); --bM: url("../images/ui/tab-m.webp");
	--bE: calc(var(--tabDiamond) * 100 / 65); --bK: 1;
}

:is(.cardButtons > .pk, #bdb):not(.open):is(:hover, :focus-visible) {
	--bL: url("../images/ui/tab-hover-l.webp"); --bR: url("../images/ui/tab-hover-r.webp"); --bM: url("../images/ui/tab-hover-m.webp");
}
:is(.cardButtons > .pk, #bdb).open {
	text-shadow: var(--glow);
	/* (its frame at the tab's edges, lined up with the other tabs'; no diamonds) */
	--bL: url("../images/ui/tab-open-l.webp"); --bR: url("../images/ui/tab-open-r.webp"); --bM: url("../images/ui/tab-open-m.webp");
	border-color: transparent;
}
.cardButtons > .pk.open { position: relative; } /* (for its diamonds; the Builder button is placed already, position: absolute) */
/* (its diamonds, the texture's left of the frame and the same mirrored: at the tab's ends, inside it, at its height (55 x 92 of the texture, its frame's rows without the glow above and below);
   both in its ::after. The tab is as tall as the row, .cardButtons: a size container for that height, 100cqh) */
.cardButtons { container-type: size; }
.cardButtons > .pk { --tabDiamond: calc(100cqh * 55 / 92); } /* (the phone layout: its own, a tab's row is not the row's height) */
.rcPath .rt {
	width: 4em;
	height: 4em;
	background-position: top center;
	background-size: 6em auto;
	cursor: auto;
}

.bt {
	border: 1px solid var(--line);
	background: var(--bgT);
	display: inline-block;
}

.skItem .sw {
	vertical-align: text-bottom;
	float: left;
}

.idChip .ci {
	margin-left: 0;
	margin-right: 2px;
}

.sc {
	margin-top: 8px;
}

.bt::before,
.compareButtons > .pk::before {
    content: "";
    display: inline-block;
    margin-right: 0.5em;
    border-left: 0.45em solid currentColor;
    border-top: 0.4em solid transparent;
    border-bottom: 0.4em solid transparent;
}

.bt.open::before {
	transform: rotate(90deg);
}

.wrapper {
	overflow: hidden;
	max-width: 100%;
	max-height: 100%;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	min-width: var(--minW);
}

#md input {
	margin-left: auto;
}

.ci {
	height: calc(1.2em + calc(0.8 * var(--vw)));
	width: calc(1.2em + calc(0.8 * var(--vw)));
	object-fit: contain;
	vertical-align: middle;
	margin: calc(-0.4 * var(--vw));
	margin-right: 4px;
    image-rendering: pixelated;
}

/* the battalion / mount named in the Gambit / Mounted Ability header (app.js renderBuildCreator headLink): plain text, on the right */
.bcHeadLink {
	float: right;
	margin-right: 4px;
	font-variant: normal;
	letter-spacing: normal;
	font-weight: normal;
	font-size: 0.92em;
}
/* a box's title that is a link (the mount, app.js renderBuildCreator mountTitle): the header's look, underlined on hover */
.calcTitle a.bcTitleLink {
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-decoration: none;
	border: 0;
	padding: 0;
	margin-bottom: 0;
}
a.bcTitleLink:hover,
a.bcTitleLink:focus-visible {
	text-decoration: underline;
}
a.bcTitleLink .si {
	margin-right: 4px;
    vertical-align: text-bottom;
}

.bcHeadLink .si {
	margin-right: 3px;
}

button.pk.cn.bcAdd {
    float: right;
    padding: 2px;
    margin-top: -6px;
}

button.pk.cn.bcAdd .si {
    margin-right: 0;
}

.row .pk {
    display: flex;
    align-items: center;
}

.ci.mi {
	height: calc(1.2em + calc(0.4 * var(--vw)));
	width: calc(1.2em + calc(0.4 * var(--vw)));
	margin-left: calc(-0.2 * var(--vw));
	margin-right: calc(calc(0.2 * var(--vw)) + 4px);
}

.tilemt .ci.mi {
    width: 1.5em;
    height: 1.5em;
    margin: 0;
    margin-right: 6px;
    vertical-align: -0.4em;
}

/* compare views (characters, weapons, combat arts and magic) */
.bt.nb::before {
	content: none;
}

.skillContainer {
	float: left;
	vertical-align: middle;
}

.skillContainer > * {
	vertical-align: text-bottom;
}

summary > .si,
summary > .sw {
	float: left;
}

.modalTitle {
	display: flex;
	align-items: center;
	font-size: 16px;
	white-space: nowrap;
	pointer-events: none;
    font-weight: bold;
}

.modalTitle>a {
    font-weight: normal;
}

.skillContainer .si {
	margin-right: 0;
}

/* ====================================================================== */
/* Compare modal (#cmp / #cmc): tables, details, headers                  */
/* ====================================================================== */

#cmp {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 9;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px 8px;
	box-sizing: border-box;
}

#cmc,
#mc {
    overflow: auto;
    margin: 2px 8px 8px 8px;
    padding: 0px 8px 8px 8px;
}

#mc > *:first-child {
	margin-top: 2px;
}

#cmc td,
#cmc th {
	border-color: var(--line);
	user-select: none;
}

.maxWidthColumn {
	width: calc(50 * var(--vw));
}

.maxWidthColumn details {
	display: inline-block;
	margin-right: 10px;
	padding: 0;
}

*[data-mt] {
	cursor: pointer;
}

#cmc .sk {
	padding: 0;
  margin: 0;
}

#cmc .sk li a.skItem {
    padding: 0;
}

#cmc .sk li .rk {
	display: none;
}

.modalabilities .growthCol {
	display: none;
}

.abilityColumn {
	width: calc(25 * var(--vw));
}

#cmc li {
	border: 0;
	padding: 1px 0;
}

#cmc .qNavMid:has(.qNavTitle) details {
	padding-bottom: 7px;
}

#cmc details:not(:first-child) {
	padding-top: 2px;
}

details {
	width: 100%;
}

details summary {
	width: 100%;
}

small details summary {
	text-decoration: underline dotted;
}

small details summary::marker {
	text-decoration: none;
}

#cmc small:not(:last-child) details:open {
	margin-bottom: 5px;
}

td.eff {
	padding: 0;
}

#cmc details:not(:first-of-type) {
	margin-top: 4px;
}

.eff,
.skill {
    text-align: right;
	white-space: nowrap !important;
}

img.ef {
    height: 1.6em;
    width: 1.6em;
    vertical-align: bottom;
}

.nameField,
.equipName,
.art-name,
.classNameField {
	min-width: 11em;
}

/* the text is centered on the :before box (top 2px, bottom 0.55vw + 2px), the header keeps its height (4px + 0.7vw of padding) */
#cmc th {
	border: 0;
	height: calc(1.5 * var(--vw));
	padding-top: calc(2px + 0.075 * var(--vw));
	padding-bottom: calc(2px + 0.625 * var(--vw));
	position: relative;
	font-weight: normal;
	text-align: center;
	padding-left: 3px;
	padding-right: 3px;
	min-width: 2.5em;
}

#cmc tbody th {
	padding: 4px 8px;
}

#cmc tbody th:not(:empty):before,
#cmc tbody th:not(:first-child):before {
	height: calc(100% - 2px);
	top: 1px;
}

#cmc th:before,
#cmc th:not(:first-child):before {
	content: "";
	position: absolute;
	left: 2px;
	width: calc(100% - 4px);
	height: calc(100% - calc(0.55 * var(--vw)) - 4px);
	border: 2px var(--border-control) solid;
	background-color: var(--surface-control);
	top: 2px;
	box-sizing: border-box;
	z-index: -1;
}

/* ====================================================================== */
/* Modal tabs & header (#cmn): tab buttons, end caps, title, tools        */
/* ====================================================================== */

:is(#cmn, #mtb, .qMissBar) .pk,
input[type="search"],
.bcSaveName,
.tile,
.classModal .rc {
	border: 2px var(--border-control) solid;
	background-color: var(--surface-control);
	border-radius: 0;
}

.pk.cn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

#cmn .pk.cn.on,
.qMissBar .pk.cn.on,
.qMissBar .pk:hover,
input[type="search"]:focus,
.bcSaveName:focus,
#cmn .pk:hover,
.compareButtons > .pk:hover,
#gfb.open,
.tile.sel,
.classModal .rc.active {
	background-color: var(--surface-control-active);
	border-color: var(--border-control-active) !important;
	outline: none;
}

#cmn .pk:hover select {
	background-color: var(--surface-control-active);
}

/* tabs (and the tab-style links to other views): no box, only the selected one has a background; the side padding leaves room
   for its end caps on every tab, so the tabs don't move when another one is selected */
:is(#cmn, #mtb) a.pk.cn[data-f],
#cmn a.pk.cn[data-view] {
	--capW: calc(var(--tabH) * 20 / 36);
    padding-left: 1em;
    padding-right: 1em;
	background-color: transparent;
	border-color: transparent;
}
/* no glow when selected (.cn.on adds one): the page's normal dark outline; hovered tabs glow */
:is(#cmn, #mtb) a.pk.cn[data-f],
#cmn a.pk.cn[data-view] {
	text-shadow: inherit;
}
:is(#cmn, #mtb) a.pk.cn[data-f]:hover,
#cmn a.pk.cn[data-view]:hover {
	text-shadow: var(--glow);
}
:is(#cmn, #mtb) a.pk.cn.on[data-f],
#cmn a.pk.cn.on[data-view] {
	color: var(--text-control-active);
}

:is(#cmn, #mtb) a.pk.cn[data-f],
:is(#cmn, #mtb) a.pk.cn[data-view] {
	border-color: transparent !important;
	margin: 0;
}

/* selected tab: the game's text page tab (CommonMenu Common_PageTabTxt_Item: a horizontal window with no content, its frame PageTabTxt_KeyHelpFrm; the left cap, the right
   one mirrored, the cap's last column stretched between them, as the game's clamped texture is (the halves below); its Select animation shows it, Default hides it)
   (::after); the caps scale with the tab height (--tabH on .mh, the cap is 20 x 36) and cover the border */
:is(#cmn, #mtb) a.pk.cn.on[data-f],
#cmn a.pk.cn.on[data-view],
.sppC .pk {
	position: relative;
	z-index: 0; /* the mirrored cap (z-index -1) stays above this background and below the text */
	border-color: transparent !important;
	background: none;
}
/* each half of the pill (::before the left, ::after the right one mirrored): the cap and its last column drawn on (PageTabTxt_KeyHelpFrm_Half: the cap, then
   that column repeated, as the game's clamped texture stretches it), scaled to the tab's real height, so the caps keep their 20 x 36 shape at any height */
:is(#cmn, #mtb) a.pk.cn.on[data-f]::before,
#cmn a.pk.cn.on[data-view]::before,
.sppC .pk::before,
:is(#cmn, #mtb) a.pk.cn.on[data-f]::after,
#cmn a.pk.cn.on[data-view]::after,
.sppC .pk::after {
	content: "";
	position: absolute;
	top: -2px;
	bottom: -2px;
	left: -2px;
	right: calc(50% - 1px); /* (1px over the middle: no seam) */
	background: url(../images/ui/PageTabTxt_KeyHelpFrm_Half.webp) left center / auto 100% no-repeat;
	z-index: -1;
	pointer-events: none;
}
:is(#cmn, #mtb) a.pk.cn.on[data-f]::after,
#cmn a.pk.cn.on[data-view]::after,
.sppC .pk::after {
	left: calc(50% - 1px);
	right: -2px;
	transform: scaleX(-1);
}

#cmc thead {
	position: sticky;
	top: 0;
	z-index: 5;
	background: url(../images/headerBG.webp);
	background-repeat: no-repeat;
	background-size: 100%;
	background-position: bottom;
	font-size: 16px;
}

#cmc th.class-skill {
	padding: 4px;
	vertical-align: top;
	padding-top: 8px;
}

/* The comparison modals' header: the title, the tabs, the max forge toggle and the sort bar + search are items of one wrapping row (#cmn and
   .mTabs are display: contents), in that order, so what doesn't fit goes to the next line from the end: first the sort bar and search
   (with the toggle when that is the one that doesn't fit), then the tabs go under the title. The tabs grow to fill the line (so the
   title is at its left and the tools at its right); an item on a line of its own is centered. The close button is in the top right
   corner: every line leaves room for it. */
#cmp .mh {
	flex-wrap: wrap;
	justify-content: center;
	padding-right: var(--mhLine);
}
#cmn,
#cmn .mTabs {
	display: contents;
}

#cmn .modalTitle {
	margin: 0 0.2em;
	flex: 0 0 auto;
	margin-right: auto; /* on a line of its own (the tabs went under it) it stays at the left, not centered with the other lines */
	/* its middle is the close button's middle: .mh pads 0.48vw at the top, so the row is the button height minus twice that */
}
/* the tabs: inline, so text-wrap: balance gives the lines about equal lengths when they wrap (6 + 6 instead of 9 + 3); a tab keeps
   its place when selected (the caps are drawn outside its box) */
#cmn .mTabList {
	flex: 1 1 auto;
	min-width: 0;
	text-align: center;
	text-wrap: balance;
}
#cmn .mTabList > a {
	display: inline-flex;
	vertical-align: middle;
	margin: 0 0.5px;
}
/* (max forge toggle +) sort bar + search: one item, natural width */
#cmn .mTools {
	display: flex;
	gap: 4px;
	flex: 0 1 auto;
	justify-content: center;
	align-self: center;
    flex-wrap: wrap-reverse;
}
/* a definite width (min / max 150 - 250px from input[type="search"]): with width auto the group was sized for a narrower box
   than the one it got, which pushed the search onto a second line */
#cmn .mTools input {
	flex: 0 1 auto;
    flex-basis: 200px;
	flex-grow: 1;
}
#cmn .mxToggle.mxOff {
	visibility: hidden;
	pointer-events: none;
}

.sr {
	cursor: pointer;
}

.smallRequirements:not(:first-child) {
	margin-left: calc(0.3 * var(--vw));
}

.smallRequirements {
	transform: scale(0.8);
	display: inline-block;
	transform-origin: left;
}

/* ====================================================================== */
/* Compare buttons & sort indicators                                      */
/* ====================================================================== */

.compareButtons {
	display: flex;
	position: absolute;
	width: 60%;
	top: calc(2.3 * var(--vw));
	z-index: 1;
	justify-content: center;
	left: 20%;
	pointer-events: none;
}

.compareButtons > .pk {
	margin: 0;
	font-size: max(14px, calc(1.1 * var(--vw)));
	padding: 0 calc(0.4 * var(--vw));
	flex-grow: 1;
	text-align: center;
	white-space: nowrap;
	text-decoration: none;
	border: 0;
	border-radius: 0;
	background: none;
	text-shadow: var(--glow);
	line-height: calc(2.2 * var(--vw));
	margin-left: -1px;
	border-left: 1px solid transparent;
	border-right: 1px solid transparent;
	position: relative;
}

.compareButtons > .pk:last-child {
	border-right-color: transparent !important;
}
.compareButtons > .pk:first-child {
	border-left-color: transparent !important;
}

.compareButtons > .pk:hover {
	z-index: 1;
}

.compareButtons > .pk:not(:last-child) {
	border-right: 1px solid var(--boxLine);
}

.sr.asc::after,
.sr.desc::after {
	content: "";
	display: inline-block;
	margin-left: 5px;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	vertical-align: middle;
	margin-right: -13px;
	position: relative;
	z-index: 1;
	filter: drop-shadow(0 0 2px black);
}

.sr.asc::after {
	border-bottom: 6px solid currentColor;
}

.sr.desc::after {
	border-top: 6px solid currentColor;
}

.cn {
	width: auto;
	border: 1px solid var(--line);
}

.cn.on {
	background: var(--sel);
	text-shadow: var(--glow);
}

/* ====================================================================== */
/* Compare table cells, recruitment, supports (.rc, .rt, .sg)             */
/* ====================================================================== */

td.cav {
	height: 48px;
	width: 48px;
	min-width: 48px;
	padding: 0;
	background-size: cover;
	background-position: top;
	background-repeat: no-repeat;
}

.artEffect .lmItem {
	text-decoration: underline dotted;
	margin-left: 3px;
}

.mi.off {
	filter: grayscale(1) brightness(0.5);
}

/* the battalion selector's icon (app.js, the b_bt button): a painted icon, not pixel art */
.ci.mi.bti {
	image-rendering: auto;
}

.tn .ci.mi {
	height: 1.2em;
	margin: 0;
	margin-left: 4px;
	margin-top: -1px;
}

a {
	text-decoration: underline;
}

a:hover {
	text-shadow: var(--smallGlow);
}

#cmc .si {
	vertical-align: text-bottom;
}

#cmc td:first-child {
	text-align: left;
}

.class-skillList > div {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	min-width: 82px;
}

#disclaimer {
	font-size: min(12px, 1em);
	width: 100%;
	text-align: center;
	color: var(--text-disclaimer);
	padding: 2px;
    padding-top: 16px;
    box-sizing: border-box;
	text-wrap: balance;
}

a.kofi,
a.disclaimerEmail {
    pointer-events: all;
    color: var(--textDark);
    text-decoration: none;
}

/* (the privacy policy and Your Privacy Choices links, above the Ko-fi link: web/privacy/, web/cookies/; the icon: the CCPA opt-out icon, about the text's height) */
.legalLinks { display: block; margin: 3px 0 5px; pointer-events: all; }
.legalLinks a { color: var(--textDark); white-space: nowrap; text-decoration: none;}

a.kofi img {
    height: 1.2em;
    vertical-align: -0.2em;
    margin-right: 2px;
}

a.kofi {
    color: var(--text);
    font-size: 1.2em;
    display: block;
    border: 2px solid var(--line);
    width: fit-content;
    margin: 0 auto;
    padding: 4px;
    background: var(--bgT);
    margin-top: 6px;
}

a.kofi:hover {
    background: var(--sel);
}

td.cav[data-ch],
td[data-cl] {
	cursor: pointer;
}

#btp,
#lgp {
	margin-top: 8px;
}

.rg th {
	white-space: nowrap;
}

.rg td {
	text-align: left;
}

/* the Fastest tab: the path's lord at the front of each cell, styled as a header; hidden until a small screen shows it (display: block) */
.fastPath {
	display: none;
	margin-bottom: 6px;
	padding: 2px 8px;
	border: 2px solid var(--border-control);
	background-color: var(--surface-control);
	text-align: center;
	font-weight: normal;
	user-select: none;
}

.rc {
	display: inline-flex;
	gap: 6px;
	margin-right: 10px;
	cursor: pointer;
}

.rc .qLink {
    max-width: 10em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
	/* Fix for underline disappearing*/
    padding-bottom: 2px;
    margin-bottom: -2px;
}

.rc a {
	color: var(--text) !important;
    text-decoration: underline dotted !important;
    text-underline-offset: 2px !important;
}

.rc.rcPath {
	cursor: auto;
}

.rc.rcPath .rcCont small {
	margin-top: 4px;
}

.rt {
	display: inline-block;
	height: 3em;
	width: 3em;
	background-size: 4.875em auto;
	background-position: -1em top;
	background-repeat: no-repeat;
	flex: none;
}

.sg {
	width: auto;
}

.sg th,
.sg td {
	padding: 0;
	min-width: 26px;
	height: 26px;
	text-align: center;
	font-size: 11px;
}

.weaponDescription,
.itemSource{
	min-width: 12em;
}

.sgh {
	width: 28px;
	height: 36px;
	background-size: auto 50px;
	background-position: top;
	background-repeat: no-repeat;
	cursor: pointer;
}

.sgr {
	white-space: nowrap;
	text-align: left;
	padding: 0 6px;
	cursor: pointer;
}

.sgr .rt {
	width: 20px;
	height: 24px;
	vertical-align: middle;
	margin-right: 6px;
}

.sgx {
	background: var(--line);
}

a.lr {
	position: relative;
	height: 38px;
	aspect-ratio: 1.5 / 1;
	display: inline-block;
	vertical-align: middle;
}

.lr,
.rt {
    background-color: var(--surface-icon-tile);
    border: 1px solid var(--border-icon-tile);
    box-sizing: border-box;
    background-clip: border-box;
    background-origin: border-box;
}

a.lr {
	background-size: auto 100%;
	background-position: center;
	background-repeat: no-repeat;
}

a.lr:hover {
    background-color: var(--surface-icon-tile-hover);
}

a.lr .rk {
	background: rgba(0, 0, 0, 0.67);
	border-radius: 50%; /* (a dark disc behind the rank, on the face) */
	position: absolute;
	right: -5px;
	top: -2px;
	margin: 0;
	z-index: 1;
}

a.lr .rk.rkQuest {
    background: transparent;
}

.lic {
	height: 1.3em;
	width: auto;
}

#cmc td {
	white-space: normal;
	border-left: 0;
	border-right: 0;
}

#cmc tbody > tr:first-child td {
	border-top: 0;
}

#cmc tbody > tr:last-child td {
	border-bottom: 0;
}

button#cmx,
button#mx,
button#sppX { /* (the selection modals' (class / battalion / mount picker, #md) button and the spoiler / Save / Load dialog's: the table modals' size and place) */
	--dim: var(--mhLine);
	height: var(--dim);
	width: var(--dim);
	padding: 0;
	line-height: var(--dim);
	position: absolute;
	top: 0;
	right: 0;
	box-sizing: content-box;
	text-align: center;
}

/* ====================================================================== */
/* Close buttons                                                          */
/* ====================================================================== */

/* close buttons (compare modal, map, picker, item popup): a crimson box with a bronze border and a drawn cross, inset in the
   button so the whole corner stays clickable; on hover it glows and the cross turns (the square looks the same turned) */
#cmx,
#lmx,
#mx,
#idx,
#shx,
#sppX,
.bcClose {
	font-size: 0; /* the ✕ text: the cross is drawn below, aria-label names the button */
	color: transparent;
	text-shadow: none;
	background: none;
	border: 0;
}
#cmx::before,
#lmx::before,
#mx::before,
#idx::before,
#shx::before,
#sppX::before,
#mapClose::before,
.bcClose::before {
	content: "";
	position: absolute;
	inset: 22%;
	box-sizing: border-box;
	border: 2px solid var(--border-control-active);
	background: var(--surface-close)
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 2l6 6M8 2l-6 6' stroke='%23ffe8c4' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E")
		center / 62% no-repeat;
	transition:
		transform 0.15s,
		filter 0.15s,
		background-color 0.15s;
	pointer-events: none;
}
#cmx:hover::before,
#lmx:hover::before,
#mx:hover::before,
#idx:hover::before,
#shx:hover::before,
#sppX:hover::before,
.bcClose:hover::before,
#cmx:focus-visible::before,
#lmx:focus-visible::before,
#mx:focus-visible::before,
#idx:focus-visible::before,
#shx:focus-visible::before,
#sppX:focus-visible::before,
.bcClose:focus-visible::before {
	transform: rotate(90deg);
	filter: var(--glowBox);
	background-color: var(--surface-close-hover);
}
/* the picker's button: as the table modals' (button#cmx: the header line's height, in the top right corner); the header keeps room
   for it on every line when it wraps (weapon tabs), as #cmp .mh does */
#md .mh {
	padding-right: var(--mhLine);
}

#cmn:empty {
	display: none;
}

input[type="search"],
.bcSaveName,
:is(#cmn, #mtb, .qMissBar) .pk {
	border-color: var(--boxLine);
	padding: 2px 4px;
	font-size: 16px;
	white-space: nowrap;
    min-height: 1.8em;
	text-decoration: none;
}

small.scrollSources {
    margin-left: 3px;
}

.rcCont small:last-child {
	display: block;
}

/* the support table's sortable header: the table modals' header cells (a framed box, the sort arrow from .sr) */
.supportTable thead th {
	position: relative;
	isolation: isolate;
	height: calc(1.5 * var(--vw));
	padding: 4px 8px;
	border: 0;
	font-weight: normal;
	text-align: center;
	user-select: none;
}

.supportTable thead th::before {
	content: "";
	position: absolute;
	inset: 2px;
	border: 2px var(--border-control) solid;
	background-color: var(--surface-control);
	box-sizing: border-box;
	z-index: -1;
}

.supportCh {
	background-size: 5em auto;
	background-position: -0.625em top;
	background-repeat: no-repeat;
	height: 2.5em;
	text-align: right;
	vertical-align: top;
	padding: 4px 8px;
	padding-top: 0.5em;
	width: 6em;
	text-shadow: var(--thickShadow);
}

div.supportCh {
	width: 15em;
}

*[data-ch] {
	cursor: pointer;
}

.supportCh a {
	margin-left: 3.5em;
	text-decoration: none;
}

.classModal {
	width: auto;
	margin: 0 auto;
}

.classModal td {
	white-space: normal;
    vertical-align: top;
}

.classModal td,
.classModal th {
	border: 0;
	padding: 0;
}

.classModal th {
	margin: 0 auto;
	padding-left: 10px;
	padding-right: 10px;
}

.rcCont {
	position: relative;
	z-index: 0;
	flex-grow: 1;
}

.rcCont .rcName {
	padding: 0;
	padding-bottom: 4px;
	padding-left: 2px;
}

.rcCont .rcName::before {
	display: none;
}

.tile.tilemt .srcK {
    margin-left: 2px;
}

.tilemt > div:first-of-type {
	margin-top: 15px;
}

small b,
small details:open,
.ln b {
	color: var(--bCol);
}

.classModal .rcCont {
	position: relative;
	z-index: 1;
	overflow: hidden;
	white-space: nowrap;
	flex-shrink: 1;
	text-align: left;
	text-overflow: ellipsis;
}

.classModal .rc {
	display: flex;
	position: relative;
	padding-left: 0;
	margin-right: 8px;
	margin-bottom: 4px;
	line-height: 2em;
	gap: 4px;
	margin-left: 8px;
	padding-right: 8px;
    align-items: center;
}

.classModal .ci {
	margin: 0;
	height: 32px;
	width: 32px;
	line-height: 1px;
}

.classListMovement {
	transform: scale(0.55);
	position: absolute;
	left: 0;
	top: 0;
	transform-origin: top left;
	display: flex;
	flex-direction: column;
	height: calc(1.818 * 2em);
	justify-content: space-between;
}

.classListWeaponTypes {
	position: absolute;
	top: 0;
	right: 0;
	line-height: 1px;
	transform: scale(0.55);
	transform-origin: top right;
	max-height: calc(1.818 * 2em);
}

.rc[data-v="Commoner"] .classListWeaponTypes,
.rc[data-v="Noble"] .classListWeaponTypes {
	display: none;
}

.classListMovement .si {
	vertical-align: top;
}

.classListMovement > *[data-l="Infantry"] {
	display: none;
}

.classModal td,
.classModal th {
	border: 0;
}

/* ====================================================================== */
/* Site search (.gsSearch)                                                */
/* ====================================================================== */

.gsSearch {
	pointer-events: all;
	left: 4%;
	top: calc(var(--vw) * 2);
	position: absolute;
	z-index: 3;
	width: 14%;
}
.gsSearch input {
	max-width: none;
	min-width: 0;
	width: 100%;
}

/* site search frame: searchboxRepeat tiled across, searchboxRight as the right end and mirrored as the left end (square, as tall as
   the box; the images are opaque, so the ends simply cover the tiles); the input is transparent on top of it */
.gsSearch {
	background: url(../images/searchboxRepeat.png) left center / auto 100%
		repeat-x;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
	/* (the tiles stop 1px inside each side, under the ends: at a fractional position their edge would show past an end's outer edge) */
	padding: 0 1px;
	box-sizing: border-box;
	background-clip: content-box;
}
.gsSearch::before,
.gsSearch::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	aspect-ratio: 1;
	background: url(../images/searchboxRight.png) 0 0 / 100% 100% no-repeat;
	pointer-events: none;
}
.gsSearch::before {
	left: 0;
	transform: scaleX(-1);
}
.gsSearch::after {
	right: 0;
}

.gsSearch #gsi,
.gsSearch #gsi:focus {
	position: relative;
	z-index: 1;
	background-color: transparent;
	border-color: transparent !important;
	/* roomier than the other search boxes; the magnifier moves in with the text, clear of the corner art */
	padding: calc(0.45 * var(--vw)) calc(1.2 * var(--vw));
	padding-left: 2em !important;
	background-position: 0.7em center;
    font-size: min(18px, max(16px, 1.1vw));
}

/* focused: the box is brightened (as brightness(1.2)), not the results dropdown (#gsr) inside it, so no filter on .gsSearch itself:
   its end pieces and the input get the filter; the tiled frame gets a color-dodge layer of rgb(43,43,43), which multiplies it by 1.2 */
.gsSearch:focus-within {
	background-image: linear-gradient(var(--surface-search-focus), var(--surface-search-focus)), url(../images/searchboxRepeat.png);
	background-size: 100% 100%, auto 100%;
	background-repeat: no-repeat, repeat-x;
	background-position: 0 0, left center;
	background-blend-mode: color-dodge, normal;
}
.gsSearch:focus-within::before,
.gsSearch:focus-within::after,
.gsSearch:focus-within #gsi {
	filter: brightness(1.2);
}

#gsr {
	position: absolute;
	top: 100%;
	left: 0;
	width: min(440px, 90vw);
	max-height: min(70vh, 520px);
	margin-top: 4px;
	overflow: auto;
	z-index: 20;
	background: var(--surface-modal);
	border: 2px solid var(--boxLine);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
	text-align: left;
	text-shadow: none;
}

#gsr .locIc {
    margin-right: 0;
}

#gsr .gsClasses {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	padding: 6px;
	width: auto;
}

#gsr .gsClasses .rc {
	margin: 0;
	flex: 1 1 160px;
}

#gsr .gsChars {
	grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
	padding: 6px;
}

.classModal th {
	padding-top: 12px;
	padding-bottom: 2px;
}

#cmn .mxToggle::before,
.qMissBar .mxToggle::before {
	content: "";
	display: inline-block;
	width: 0.8em;
	height: 0.8em;
	margin-right: 6px;
	border: 2px solid var(--boxLine);
	background: var(--surface-inset);
	vertical-align: middle;
}

#cmn .mxToggle.on::before,
.qMissBar .mxToggle.on::before {
	border-color: var(--border-control-active);
	background: var(--surface-inset)
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3' fill='none' stroke='%23ffe8c4' stroke-width='2'/%3E%3C/svg%3E")
		center / 90% no-repeat;
}

#cmc .bn {
	font-size: 10px;
	right: -10px;
	top: -5px;
}

.combatArt {
	min-width: 12em;
}

.mount-abilities {
	width: min(20vw, 300px);
}

.class-growth,
.class-skill,
.equipStat,
.weaponTrait {
	padding: 2px;
	font-size: 16px;
}

.class-growth small:not(.tableSv) {
	display: block;
}

#cmc th.class-skill {
	padding: 6px;
	vertical-align: top;
	padding-right: 12px;
}

#cmc th.class-skill .sw {
	line-height: 1.25vw;
	vertical-align: baseline;
}

#cmc th.class-skill img {
	height: 1.25vw;
	margin-right: -6px;
}

.class-requirements {
	text-align: left;
}

.class-requirements > div:first-child {
	display: flex;
	justify-content: space-between;
	white-space: nowrap;
}

.class-requirements > small:first-of-type {
	display: block;
}

.characterName {
    padding-left: 0;
}

td.characterName a {
	text-decoration: none;
	font-weight: bold;
    vertical-align: middle;

}
td.characterName {
	text-align: left;
	white-space: nowrap !important;
	padding-top: 0;
	padding-bottom: 0;
}

.rcAllP {
	margin: 0 0 12px; /* at the top of the recruitment tab, above the paths */
	font-size: min(16px, 1.2em);
	line-height: 140%;
}
/* the item popup's "Highlight all N locations on map" (a small info link), next to its "How to get" heading */
.idMapAll {
	display: inline-block;
	margin-left: 10px;
	color: var(--text);
    max-width: calc(100% - 16px - 130px); /* Make it fit with the map image on small screens */
}
.idMapAll > a.arrowLink {
	display: inline-block; /* not a list item here: on the heading's line */
}

.grid2 .sk {
	padding-left: 0;
}

/* (as many columns as fit, none narrower than 12em: the widest gift button's content (Odd Vegetable Seeds, its G/P and +points, on one line); no per-screen column counts) */
.giftList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12em, 1fr));
	gap: 6px;
	align-items: start;
	margin-top: 8px;
	font-size: min(15px, 1.14286em);
}

.foodList {
	font-size: min(15px, 1.14286em);
}

.giftSuggestion {
    border: 1px solid var(--line);
    padding: 4px;
    background-color: var(--surface-gift-suggestion);
    filter: drop-shadow(1px 1px 1px black) drop-shadow(0px 0px 0px black);
}

.giftSuggestion .srcK {
    font-size: 0.85em;
    letter-spacing: normal;
    margin-left: 0.4em;
}

@media screen and (max-width: 1400px) {
	.largeV {
		display: none;
	}
}

@media screen and (max-width: 1000px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) { /* (and the portrait layout at every width: it is laid out at 800 px, index.html scaleToFit) */
	.largeV {
		display: none;
	}
}

.giftContainer h1:not(:first-child) {
	margin-top: 12px;
}

/* an item button with a note (starting equipment's conditions): the button, then the note under it */
.giftItem {
	display: inline-flex;
	flex-direction: column;
	gap: 2px;
}
.giftItem > small {
	color: var(--mut);
	font-size: 0.8em;
	padding: 0 4px;
}

.sv {
	display: none;
}

.dottedUnder {
	text-decoration: underline dotted;
}

.rcPath b a {
	padding-top: 3px;
	padding-bottom: 3px;
}

.idHidden .si {
	margin-right: 4px;
}

/* a character's Recruitment tab (app.js renderCharacterRecruitment): a card a path, 2 x 2, one column on a narrow screen; as the game's character cards (the Records'
   pairs: a thin framed panel, the portrait on its left cut by the frame, the name over a gold haze and the gold title rule, the epithet under it, the fields as the profile's) */
/* (the starting equipment's box above the cards, as the liked gifts' Suggested) */
.rcEquip { margin: 0 0 12px; }
.rcEquip .giftSuggestion { margin: 0; }
.rcCards {
	--prfLabel: #d5c5a8;
	--prfValue: #f8f0dc;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 0 0 16px;
}
@media screen and (max-width: 700px) {
	.rcCards { grid-template-columns: minmax(0, 1fr); }
	/* (a phone: the four cards in one screen without scrolling: smaller text and spacing, the support level and the renown side by side) */
	.rcCards { gap: 6px; }
	.rcCards .rcCard {
        padding-left: 20%;
        min-height: 5.2em;
        border-image-width: 18px;
        width: 20em;
		max-width: 100%;
        margin: 0 auto;
	}
	.rcCards .rcPortrait { max-width: 30%; }
	.rcCards .rcBody { padding: 5px 8px 5px 0; }
	.rcCards .rcTitle { padding: 2px 8px 4px; }
	.rcCards .rcTitle > a { font-size: 1.15em; }
	.rcCards .rcTitle > span { font-size: .85em; }
	.rcFields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 10px; }
	.rcCards .rcCard .prfField { padding: 3px 8px 2px; font-size: .9em; }
	.rcCards .rcNote { padding: 2px 8px; font-size: .82em; }
}
.rcCard {
	position: relative;
	display: block;
	padding-left: 34%;
	min-width: 0;
	min-height: 10.5em;
	overflow: hidden;
	border-image: url("../images/ui/rc-frame.webp") 78 fill / 26px stretch;
}

.rcPortrait {
	position: absolute;
	left: 1px;
	top: 1px;
	height: calc(100% - 2px); 
	aspect-ratio: 1;
	max-width: 40%;
	object-fit: cover;
	object-position: 50% 0;
	pointer-events: none;
	-webkit-mask: url("../images/ui/rc-face-mask.webp") 0 0 / 100% 100% no-repeat;
	mask: url("../images/ui/rc-face-mask.webp") 0 0 / 100% 100% no-repeat;
}
.rcBody {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	padding: 10px 12px 10px 0;
	min-width: 0;
}
/* the name (its recruitment list) and when they join, over a gold haze (the game's brush stroke) and the gold title rule */
.rcTitle {
	display: flex;
	flex-direction: column;
	position: relative;
	padding: 4px 12px 8px;
	margin-bottom: 2px;
	background: url("../images/ui/prf-rule.webp") left bottom / auto 4px repeat-x;
	font-family: "Nocturne", serif;
	letter-spacing: .06em;
}
/* (the game's brush stroke behind the name, with its sparkles: AfterEpisode_BgName, from just left of the name over its width) */
.rcTitle::before {
	content: "";
	position: absolute;
	z-index: -1;
	left: -12%;
	top: -14%;
	width: 100%;
	height: 110%;
	background: url("../images/ui/rc-glow.webp") left center / 100% 100% no-repeat;
	pointer-events: none;
}
.rcTitle > a {
	color: #f3e4c9 !important;
	font-size: 1.35em;
	text-decoration: none !important;
	text-shadow: 0 0 7px rgba(214, 186, 132, .22);
}
.rcTitle > a:hover { text-decoration: underline dotted !important; text-underline-offset: 3px; }
.rcTitle > span { color: #c1b39a; font-size: .95em; }
.rcCard .prfField { padding: 5px 12px 3px; }
.rcCard .prfField .rnIc { height: 1em; vertical-align: -1px; margin-right: 3px; }
/* the notes: text on lines, as the game's text panel */
.rcNotes { margin-top: 2px; }
.rcNote {
	padding: 4px 12px 3px;
	color: var(--prfValue);
	font-size: .92em;
	background: url("../images/ui/prf-line.webp") left bottom / auto 4px repeat-x;
}
.rcCard .rcNote a,
.rcCard .rcTitle span a {
	color: var(--prfValue);
	text-decoration: underline dotted;
	text-underline-offset: 2px;
}
/* a path they cannot be recruited on: dimmed, the portrait grey */
.rcCard.noRecruitPath { opacity: .55; }
.rcCard.noRecruitPath .rcPortrait { filter: grayscale(1) brightness(.75); }
/* (narrow cards, wherever the space is small (a tablet's content column, ~300 px a card): the phone's smaller text and spacing, the path's name on one line) */
.rcCards { container-type: inline-size; }
@media screen and (min-width: 701px) { /* (a phone has its own, above) */
@container (max-width: 720px) {
	.rcCards .rcCard { padding-left: 27%; min-height: 6.5em; border-image-width: 18px; }
	.rcCards .rcPortrait { max-width: 30%; }
	.rcCards .rcBody { padding: 5px 8px 5px 0; }
	.rcCards .rcTitle { padding: 2px 8px 4px; }
	.rcCards .rcTitle > a { font-size: 1.15em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.rcCards .rcTitle > span { font-size: .85em; }
	.rcCards .rcCard .prfField { padding: 3px 8px 2px; font-size: .9em; }
	.rcCards .rcNote { padding: 2px 8px; font-size: .82em; }
}
}

.classNameField b {
	margin-right: 4px;
}

.classNameField .ci {
	width: 32px;
	height: 32px;
    margin: -7px;
    margin-right: 3px;
}

a.itemLink {
	text-decoration: underline dotted;
	text-underline-offset: 2px;
	cursor: pointer;
}

a.itemLink:hover {
	color: var(--text);
}

.idNote + .idNote {
	margin-top: 8px;
}

.lmItem .si {
	margin-right: 4px;
	vertical-align: text-bottom;
}

.lmItem {
	vertical-align: text-bottom;
}

.skill {
    padding-left: 2px;
    padding-right: 2px;
}

.weaponTrait,
.spellTrait,
.equipTrait,
.equipStat {
	padding-left: 4px;
	padding-right: 4px;
	white-space: nowrap !important;
}

.tableSv {
	display: none;
	overflow: hidden;
	text-overflow: ellipsis;
    font-size: 12px;
}

#sortBar {
	display: none;
}

.sortToggle {
	flex-basis: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font: inherit;
	background: transparent;
	border: 0;
	outline: none;
	color: inherit;
	padding: 0 4px;
	cursor: pointer;
}

.sortArrow {
	transition: transform 0.15s;
}

#sortBar.open .sortArrow {
	transform: rotate(180deg);
}

#sortBar { position: relative; }
#sortBar .sortMenu { display: none; }
#sortBar.open .sortMenu {
	display: flex;
	flex-direction: column;
	position: absolute;
	top: calc(100% + 3px);
	left: -2px;
	z-index: 20;
	min-width: calc(100% + 4px);
	box-sizing: border-box;
	padding: 2px;
	background: var(--surface-control);
	border: 2px solid var(--border-control);
	box-shadow: 0 4px 10px #000a;
    max-height: 60vh;
    overflow: auto;
}
#sortBar .sortChip { text-align: left; white-space: nowrap; }
#sortBar .sortChip:hover {
    background-color: var(--surface-control-active) !important;
}

.flex-break {
	flex-basis: 100%;
	height: 0;
}

.sortChip {
	font: inherit !important;
	background: transparent !important;
	outline: none !important;
	border: 0 !important;
	color: inherit !important;
	padding: 2px 7px !important;
	cursor: pointer !important;
	flex-basis: 1px !important;
	width: auto !important;
	min-width: auto !important;
	max-width: none !important;
	height: auto !important;
	min-height: auto !important;
	max-height: none !important;
}

.giftContainer small {
	font-weight: normal;
}

.sortChip::after {
	content: "";
	position: absolute;
}

.sortChip.asc::after {
	content: " ▲";
}

.sortChip.desc::after {
	content: " ▼";
	visibility: visible;
}

.art-skill {
	white-space: nowrap !important;
}

select.sortSel {
	background: none;
	border: 0;
	max-width: 100%;
	font: inherit;
	background: var(--surface-control);
	border-radius: 0;
	outline: none;
	padding: 2px;
}

#sortBar label {
	display: flex;
	white-space: nowrap;
	align-items: center;
	gap: 6px;
}

#cmc td:first-child b {
	white-space: normal;
}

.lmItem.lmClass .ci {
    margin-left: -0.2em;
    margin-top: -0.2em;
    margin-bottom: -0.2em;
    margin-right: 2px;
    vertical-align: -0.5em;
    height: 2em;
    width: 2em;
}

.idSec .chp .bn {
    right: -8px;
	transform: scale(0.9);
	transform-origin: top right;
}

.idSec-skills .chp .bn {
    right: -6px;
}

.idSec-skills .chp {
	margin: 4px;
}

.noMatch {
    font-size: 16px;
    margin-left: 1em;
}

/* ====================================================================== */
/* World map popup (map.js)                                               */
/* ====================================================================== */

/* ---------- world map popup (map.js) ---------- */
a.loc,
.idText .lmItem,
.idReq .lmItem,
.idSec .lmItem {
	text-decoration: underline dotted;
	text-underline-offset: 2px;
	cursor: pointer;
}

#lmp {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 15;
	display: flex;
	justify-content: center;
	box-sizing: border-box;
}
#lmp .mb {
	height: 100%;
}
/* the map window's frame (.mb::before, list-window.webp at --frm): full size in the normal layouts at every width (not the lists' 0.75 / 0.5 below 1100px / 900px),
   half size in the compact ones (the media block below) */
#lmp { --frm: 1; }
#lmn {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	align-items: center;
	width: 100%;
	padding-right: 38px;
}
#lmn .pk,
#lmf .pk {
	border: 2px solid var(--boxLine);
	background-color: var(--surface-control);
	border-radius: 0;
	padding: 0.18vw 0.6vw;
	font-size: 16px;
	white-space: nowrap;
	text-decoration: none;
}
#lmn .pk.on,
#lmn .pk:hover,
#lmf .pk.on,
#lmf .pk:hover,
#lmd .pk.lmHubBtn.on,
#lmd .pk:hover {
	background-color: var(--surface-control-active);
	border-color: var(--border-control-active);
}
#lmn .pk.lmOff {
	opacity: 0.5;
}
/* (the map's close button: .closeFixed, 60px at every width; the room kept for it (the search's width, the zoom buttons' top) uses the same --lmxDim) */
#lmp { --lmxDim: 60px; }
#lmx {
	--dim: var(--lmxDim);
	position: absolute;
	top: 0;
	right: 0;
	height: var(--dim);
	width: var(--dim);
	padding: 0;
	text-align: center;
	font-size: max(16px, 1.2 * var(--vw) + 1px);
}

.tilemt .si {
    height: 1.2em;
    margin-right: 4px;
}

.lmShot {
    display: block;
    width: 200px;
    height: auto;
    object-fit: cover;
    margin: 0 0 2px 6px;
    float: right;
    max-width: 35%;
    aspect-ratio: 1;
    z-index: -1;
    position: relative;
	top: -4px;
	aspect-ratio: 1 / 1;

/*-webkit-mask-image: 
	radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%),
	radial-gradient(circle at 20% 30%, black 0%, transparent 50%),
	radial-gradient(circle at 80% 40%, black 0%, transparent 45%),
	radial-gradient(circle at 30% 75%, black 0%, transparent 55%),
	radial-gradient(circle at 70% 70%, black 0%, transparent 50%);

mask-image: 
	radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%),
	radial-gradient(circle at 20% 30%, black 0%, transparent 50%),
	radial-gradient(circle at 80% 40%, black 0%, transparent 45%),
	radial-gradient(circle at 30% 75%, black 0%, transparent 55%),
	radial-gradient(circle at 70% 70%, black 0%, transparent 50%);

-webkit-mask-composite: source-over;
mask-composite: add;*/
    /*border: 1px solid var(--line);
    background-color: #1c2d30;
    padding: 4px;*/
    box-sizing: border-box;
    /* the painted-edge mask: locationMaskAlpha.png is locationMask.png (white shows, black hides) with its brightness turned into transparency,
       so it works as an ordinary (alpha) mask, -webkit- prefixed too, in older browsers as well. After changing locationMask.png: node worker/mask-alpha.js */
    -webkit-mask-image: url(../images/map/ui/locationMaskAlpha.webp);
    mask-image: url(../images/map/ui/locationMaskAlpha.webp);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}
.lmShot[hidden] {
    display: none;
}

#lmf {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	padding: 4px calc(1 * var(--vw));
	font-size: 13px;
	display: none;
} /*Disabled */
#lmf .lmGroup {
	display: flex;
	flex-wrap: wrap;
	gap: 3px;
	align-items: center;
}
#lmf .pk {
	font-size: 13px;
	padding: 1px 6px 1px 2px;
	display: inline-flex;
	align-items: center;
	gap: 3px;
}
#lmf .pk:not(.on) {
	opacity: 0.45;
	background-color: transparent;
}
#lmf .pk img {
	height: 18px;
}

.lmFindText .loc {
    color: var(--text);
}

#lmb {
	flex: 1;
	min-height: 0;
	display: flex;
	gap: 8px;
	margin: 0 14px 14px;
	padding-top: 4px;
}
#lmv {
	flex: 1;
	min-width: 0;
	position: relative;
	overflow: hidden;
	background: var(--surface-location-view);
	border: 2px solid var(--boxLine);
	touch-action: none;
	cursor: grab;
	user-select: none;
}
#lmv.drag {
	cursor: grabbing;
}
#lmw {
	position: absolute;
	left: 0;
	top: 0;
	transform-origin: 0 0;
}
#lmk {
	position: absolute;
	inset: 0;
}

/* the dashed lines from a selected posthouse to the posthouses it connects to */
.lmLines {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	overflow: visible;
    filter: drop-shadow(1px 1px 0px black) drop-shadow(0 0 1px black);
}

.lmLines line {
	stroke: var(--stroke-location-lines);
	stroke-width: 2;
	stroke-dasharray: 7 6;
	stroke-linecap: round;
	opacity: 0.85;
	vector-effect: non-scaling-stroke;
}

.idText .lmItem {
    vertical-align: baseline;
}

.lmSec .srcK .lmItem {
    vertical-align: baseline;
}

.lmSec .srcK.lmChestList .lmItem {
    vertical-align: bottom;
}

/* the map picture as tiles (map.js updateTiles): each placed and sized in percent of the map */
#lmt {
	position: absolute;
	inset: 0;
	pointer-events: none;
}
/* the overlay tiles (markers drawn over everything): above the pins (their z-index goes up to 5), clicks go through to the pins */
#lmo {
	position: absolute;
	inset: 0;
	z-index: 10;
	pointer-events: none;
}
#lmt img, #lmo img {
	position: absolute;
	display: block;
	max-width: none;
	user-select: none;
}

.lmm {
	-webkit-touch-callout: none; /* no link menu / preview when a pin is held (iOS) */
	text-decoration: none;
	-webkit-user-drag: none;
	position: absolute;
	width: var(--pin, 26px);
	height: var(--pin, 26px);
	padding: 0;
	border: 0;
	background: none;
	transform: translate(-50%, -50%);
	cursor: pointer;
	/*filter: drop-shadow(0 1px 2px #000);*/
}
/* the pin's icon (its background-image comes from the category: map.js pinClass) is drawn by the ::before, so it can be styled on its own */
/* drawn at 100px and scaled down to the pin's size (--pinN: the pin size as a number, map.js apply; --k: the category's size, --sel: the selected pin's):
   a background drawn at a few pixels is rounded to whole pixels on each side, which bent the non-square icons when zoomed out; a transform is not rounded */
.lmm { --k: 1; --sel: 1; }
.lmm.lmmBig { --k: 1.35; }
.lmm.lmmMid { --k: 1.2; }
.lmm.p-base, .lmm.p-capital { --k: 1.65; }
.lmm.on { --sel: 1.45; }
.lmm.off { --pinN: var(--pinOffN); }
.lmm::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 100px;
	height: 100px;
	background: center / contain no-repeat;
	transform: translate(-50%, -50%) scale(calc(var(--pinN, 26) * var(--k) * var(--sel) / 100));
	pointer-events: none;
}
.lmm:not(.on):hover {
	z-index: 2;
	transform: translate(-50%, -50%) scale(1.25);
}
.lmm.on {
	z-index: 3;
	width: calc(var(--pin, 26px) * 1.45);
	height: calc(var(--pin, 26px) * 1.45);
	border-radius: 50%;
	box-shadow:
		0 0 0 3px var(--text),
		0 0 14px 4px var(--glow-marker-on);
	background-color: rgba(0, 0, 0, 0.45);
}

#lmd .idSelect {
    display: none;
}

.lmm.lmmBig {
	width: calc(var(--pin, 26px) * 1.35);
	height: calc(var(--pin, 26px) * 1.35);
}

.lmm.lmmBig.on {
	width: calc(var(--pin, 26px) * 1.35 * 1.45);
	height: calc(var(--pin, 26px) * 1.35 * 1.45);
}

.lmAlso {
	margin-right: 4px;
}

a.loc,
a.lmItem,
a.itemLink,
.giftBtn {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
    vertical-align: text-bottom;
}

a.lmItem {
	white-space: normal;
}

.lmm.off {
  --pin: var(--pinOff);
}

.lmm.p-base,
.lmm.p-capital {
	width: calc(var(--pin, 26px) * 1.65);
	height: calc(var(--pin, 26px) * 1.65);
}

.lmm.p-base.on,
.lmm.p-capital.on {
	width: calc(var(--pin, 26px) * 1.65 * 1.45);
	height: calc(var(--pin, 26px) * 1.65 * 1.45);
}

.lmm.lmmMid {
	width: calc(var(--pin, 26px) * 1.2);
	height: calc(var(--pin, 26px) * 1.2);
}

.lmm.lmmMid.on {
	width: calc(var(--pin, 26px) * 1.2 * 1.45);
	height: calc(var(--pin, 26px) * 1.2 * 1.45);
}
#lmz {
	position: absolute;
	right: 8px;
	top: 8px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	z-index: 4;
}
#lmz .pk {
	width: 32px;
	height: 32px;
	padding: 0;
	text-align: center;
	font-size: 18px;
	border: 2px solid var(--boxLine);
	background-color: var(--surface-control);
}
#lmd {
	width: max(30vw, 320px);
	flex: none;
	overflow: auto;
	padding: 4px 8px;
	box-sizing: border-box;
	font-size: 15px;
    scrollbar-gutter: stable;
}
/* the location's own picture: behind everything at the top of the panel, fading out downwards (it scrolls with the panel) */
#lmd {
	position: relative;
	isolation: isolate;
	container-type: inline-size; /* cqw: the panel's width */
}
#lmd .lmLocImg {
    position: absolute;
    top: 0px;
    left: 0;
    width: 100%;
    height: min(50cqw, 240px);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    opacity: 0.7;
    pointer-events: none;
    /* the edges fade out (left, right and top), the top corners a little more with a radial fade, and the bottom as before: all the layers together */
    /*-webkit-mask-image: linear-gradient(#000 60%, transparent), linear-gradient(#000 60%, transparent), linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, transparent, #000 26%), radial-gradient(circle at 0 0, transparent, #000 40%), radial-gradient(circle at 100% 0, transparent, #000 40%);
    mask-image: linear-gradient(#000 60%, transparent), linear-gradient(#000 60%, transparent), linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, transparent, #000 26%), radial-gradient(circle at 0 0, transparent, #000 40%), radial-gradient(circle at 100% 0, transparent, #000 40%);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-composite: source-in;
    mask-composite: intersect;*/

    -webkit-mask-image: url(../images/map/ui/locImgMask.webp);
    mask-image: url(../images/map/ui/locImgMask.webp);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}
#lmd h2 {
    margin-top: 7px;
    font-variant: small-caps;
    font-weight: bold;
    text-shadow: var(--weakGlow);
	margin-bottom: 4px;
}

.lmFindSec .idPic {
    margin: 8px 0;
}

.lmFindSec .lmItem {
	color: var(--text);
}

#lmd h2 .lmRegion {
    text-shadow: var(--bodyShadow);
}


.lmQuestDetail .lmRegion {
    color: var(--lighter);
    display: block;
}
/* the divider under the location's name stops at the map picture (a block formatting context gets narrower beside a float) */
#lmd > .divider {
	display: flow-root;
}
/* the region next to the location's name */
.lmRegion {
	color: var(--textDark);
	font-size: 0.65em;
	font-weight: normal;
	margin-left: 4px;
}
/* the picture floats right: the panel always reaches its bottom edge, even when the text is shorter */
#lmd::after {
	content: "";
	display: block;
	clear: both;
}
.lmMeta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	color: var(--mut);
	margin-left: 0.3em;
}
.lmCat {
	display: inline-flex;
	align-items: flex-start;
	gap: 4px;
	color: var(--text); /* the place's type and its icon in the normal text colour (the region next to it stays muted) */
}
/* the type and the region as links (map.js: a click lists every place of that type / in it): their text colours, underlined on hover */
a.lmCat {
	text-decoration: none;
	color: var(--text); /* (as .lmCat: the link's colour would win) */
}
.lmRegion a {
	text-decoration: none;
	color: inherit;
}
a.lmCat:hover,
a.lmCat:focus-visible,
.lmRegion a:hover,
.lmRegion a:focus-visible {
	text-decoration: underline;
	outline: none;
}
.lmCat img {
	height: 18px;
	aspect-ratio: 1 / 1;
}

.lmDesc,
.lmHint,
.lmMeta,
.lmRepair,
#lmd h2 {
    filter: drop-shadow(1px 1px 1px black) drop-shadow(0px 0px 0px black);
}

.lmDesc,
.lmHint,
.lmFindText {
    color: var(--mid);
	margin: 8px 0;
	text-wrap: balance;
}
.lmSec {
	margin: 10px 0;
	margin-bottom: 16px;
}

.lmSec:last-child {
    margin-bottom: 0;
}
/* the sections (battalions, shops, items, ...) start below the map picture, not beside it; the description above them, the framed repair box and, on an item's
   search, the "Found at" list wrap around it */
#lmd .lmSec:not(.lmRepair, .lmFound) {
	clear: both;
}
/* the "Found at" list wraps around the picture: its divider narrows beside it (a block of its own), the rows' lines stop at the picture's edge and run full width below it */
#lmd .lmFound .divider {
	display: flow-root;
}
/* Part 3 town repair materials: first in the panel, framed and tinted so they stand out */
.lmSec.lmRepair {
	display: flow-root; /* a framed box next to the picture (.lmShot) narrows beside it, its border does not run under it */
	padding: 6px 10px 8px;
	border: 2px solid var(--border-repair);
	background: var(--surface-repair);
}
.lmRepair > b,
.lmRepairRews > b {
	color: var(--accent-repair);
}
.lmRepair .lmQty {
	color: var(--text);
	font-weight: bold;
}
.lmSec ul {
	list-style: none;
	margin: 2px 0 0;
	padding: 0;
}
.lmSec li {
	padding: 2px 0;
	border-bottom: 1px solid var(--line);
	display: flex;
	align-items: center;
	gap: 4px;
}


.lmAlsoIc {
    height: calc(1.6em - 4px);
    width: auto;
    margin-right: 3px;
    vertical-align: bottom;
    margin-left: -4px;
    margin-top: 2px;
    margin-bottom: 2px;
}

.lmAlsoSec a {
	display: inline-flex !important;
}

#lmb .lmAlsoSec .lmQuickFace {
    height: calc(1.6em - 4px);
    width: calc(1.6em - 4px);
    margin-right: 4px;
}

.lmCols {
	display: flex;
	gap: 10px;
}

.classNameField .ci {
    vertical-align: text-bottom;
}

.lmCols > .lmSec {
	flex: 1;
	margin: 0;
}
.lmIc {
	height: 20px;
	width: 20px;
	object-fit: contain;
}

.idChip .lmIc {
    vertical-align: text-bottom;
    margin-right: 4px;
}

#lmd .pk {
	border: 2px solid var(--boxLine);
	background-color: var(--surface-control);
	padding: 4px 6px;
	margin: 2px 0;
	display: inline-block;
	text-decoration: none;
}

.lmFind .pk.clearFind {
	border: 0;
	padding: 0 4px;
    margin-left: auto !important;
	aspect-ratio: 1 / 1;
    display: flex !important;
    align-items: center;
}

#mapClose {
	display: none;
}

#lma {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px;
    align-content: center;
}

@media (max-width: 600px), (orientation: portrait) {
	#lmp .mb {
		isolation: isolate;          /* .mb becomes a stacking context, so z-index: -1 below stays above its own background */
	}
	#lmp .mb::before,
	#lmp .mb::after {
		z-index: -1;                 /* the frame pictures go behind everything inside .mb */
	}
	#lmb {
		position: relative;
		flex-direction: column;
		z-index: auto;               /* no stacking context: .lmSearch (z 4) and #lmr can rise above .mh (z 2) */
	}

	#lmb > .lmSearch {
		position: absolute;
        top: 10px;
        left: 6px;
		z-index: 4;
		margin: 0;
		flex: none;
		min-width: 0;
		width: min(180px, calc(100% - 100px));
	}

	#lmd {
		width: auto;
		height: 50%;
	}
	#lmf {
		flex-wrap: nowrap;
		overflow-x: auto;
	}
	#lmf .lmGroup {
		flex-wrap: nowrap;
	}
}

@media (max-width: 900px), (max-height: 500px) { /* (the map's compact layouts: from 900px wide, the lists' narrow threshold, or a low window) */
	#lmp { --frm: 0.5; }

	/* (the narrow lists' frame (the 1100px block's .mb::before): the map's from here) */
	#lmp .mb::before {
		border-width: calc(152px * var(--frm, 1)) calc(72px * var(--frm, 1)) calc(72px * var(--frm, 1)) calc(120px * var(--frm, 1));
		border-image: url(../images/ui/list-window.webp) 152 72 72 120 fill / calc(152px * var(--frm, 1)) calc(72px * var(--frm, 1)) calc(72px * var(--frm, 1)) calc(120px * var(--frm, 1));
	}

	/* (the narrow lists' header padding and margin, from the 900px block: for the map only here) */
	#lmb {
		margin: 0 4px 4px;
	}

	#mapClose {
		display: block;
	}

	#lmp #lmx {
		display: none;
	}

	#lmv {
		border-left-width: 0;
		border-right-width: 0;
		border-top-width: 0;
        margin: 0 -4px;
        margin-top: -4px;
	}

	#lmp .mh {
		padding-left: 2px;
		padding-bottom: 4px;
		padding-top: 5px;
        margin-left: 3px;
        position: absolute;
        bottom: calc(50% + 13px);
        pointer-events: none;
        background: transparent;
        align-items: flex-end;
	}

	#lmn {
    	flex-wrap: wrap-reverse;
	}

	#lma {
    	flex-wrap: wrap-reverse;
	}

	#lmb > .lmSearch {
        pointer-events: all;
        top: 4px;
        left: 0;
	}

	#lmb > .lmSearch > input {
		height: 26px;
	}
}

@media (orientation: landscape) and (max-height: 500px) and (min-width: 601px), (orientation: landscape) and (max-width: 900px) and (min-width: 601px) { /* (compact landscape) */
	#lmv {
        border-bottom-width: 0;
        border-right-width: 2px;
        border-top-width: 0;
        margin: 0px -4px;
        margin-top: -4px;
        margin-right: 0;
        margin-bottom: -4px;
	}

	#lma {
    	flex-wrap: wrap;
    	align-content: flex-start;
	}

    /* (the header across the whole window, whatever its width (it was the window's width from 8px in: the close button half off the right edge); the route buttons
       8px inside the map's top-left corner, as the zoom buttons are inside its top-right (the map (#lmv): 3px in from the left, 12px down at --frm 0.5) */
    #lmp .mh {
        top: 0;
        bottom: auto;
        left: 0;
        right: 0;
        width: auto;
        margin: 0;
        padding: 12px 0 0 12px;
        align-items: flex-start;
    }
    #lmp #lmx {
        top: 2px;
        right: 8px;
        pointer-events: all;
    }

	#lmp .lmSearch {
        pointer-events: all;
    	min-width: auto;
		width: 1px;
		min-width: calc(max(30vw, 320px) - var(--lmxDim) + 8px);
		max-width: none;
		flex: 0;
	}

	#mapClose {
		display: none;
	}

	#lmp #lmx {
		display: block;
        top: -3px;
        right: -3px;
	}

	#lmd {
    	margin-top: 36px;
	}

    #lmn {
        flex-wrap: nowrap;
        padding-right: 60px;
    }

	#lma {
		height: 28px;
        max-width: calc(100% - max(30vw, 320px) - 1vw - 28px);
	}
}

.acqInline {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 10px;
    flex-direction: column;
}

.acqInline .acqLoc {
	white-space: nowrap;
}

.acqLoc .lmItem,
.lmFindText .lmItem {
	text-decoration: dotted underline;
}

.acqLoc .acqTrade {
    padding-top: 2px;
    padding-left: 15px;
}

.lmFindText .lmIc {
    height: 1em;
    width: 1em;
}

/* item popup: a source's whole description, under its map link */
.acqFull {
	margin: 1px 0 6px;
}
.acqFull .acqLead {
	color: var(--text);
}
.acqFull:last-child {
	margin-bottom: 0;
}

/* a location's shops one under the other, each the whole width, with its items in columns (as many as fit at least as wide as the longest item name) */
.lmShopGrid {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.lmShopGrid > .lmSec {
	margin: 0;
}

.lmShopGrid > .lmSec > ul {
	columns: 2 200px; /* two columns at most (one when the panel is narrower than two) */
	column-gap: 14px;
}

.lmShopGrid > .lmSec > ul > li {
	break-inside: avoid;
}

/* a location's battalions in columns like its shops' items */
.lmBattalions > ul {
	columns: 2 200px; /* two columns at most (one when the panel is narrower than two) */
	column-gap: 14px;
}

.lmBattalions > ul > li {
	break-inside: avoid;
	display: flex;
	align-items: center;
	gap: 5px; /* the rank in front of the battalion, on one line with it */
}

.idSec[data-sec="classes"] .idChip .lmClass .ci {
	width: 1.55em;
	height: 1.55em;
	margin: -0.15em;
	margin-right: 4px;
    vertical-align: text-bottom;
}

.lmPrice {
	margin-left: 6px;
}

/* the Vandahl Trading Co.'s list (stock and trades), in the shop grid like the other shops */
/* a trade: the item (and its stock) on the first line, what it costs below it, on the right */
/* the Vandahl Trading Co.'s list in two columns wherever it is (in the shop grid, or on its own where the location has no shop lists) */
.lmVx > ul {
	columns: 2 200px;
	column-gap: 14px;
}
.lmVx > ul > li {
	break-inside: avoid;
}

/* the travelling merchants' lists in two columns too (Gift merchant, Oren's merchants, ...) */
.lmMerchant > ul {
	columns: 2 200px;
	column-gap: 14px;
}
.lmMerchant > ul > li {
	break-inside: avoid;
}
/* a travelling merchant's odds and other spots (map.js vendorsAt), under its stock */
.lmVendorInfo {
	margin-top: 4px;
	font-size: 92%;
	color: var(--mut);
}

.lmVendorOdds {
	font-size: 100%;
    margin-bottom: 4px;
    margin-top: 0;
    margin-left: 1em;
}

.lmVendorInfo b {
	color: var(--fg);
}

.lmVendorInfo .loc {
	color: var(--text);
    margin-right: 4px;
}

.lmVendorInfo p {
	margin: 2px 0;
}
/* a location's travelling merchants: the region's chance of a merchant as the header, then the merchants in one block with a line on its left */
.lmVendorList {
	padding-left: 10px;
	position: relative;
}

.divider.verticalDivider {
    position: absolute;
    left: 0;
	height: 100%;
	background-image: url(../images/dividerV.webp);
    width: 2px;
    margin: 0;
}

/* under a merchant's name, on a line of its own, in plain text (not the title's small caps): where it stands when that is a waypoint */
.lmVendorWhere {
	display: block;
	font-variant: normal;
	letter-spacing: normal;
	font-weight: normal;
}
/* the price (and stock) of a merchant's item floats right (the row is the whole width of its column) */
/* a stock line's note: on the next line under the item (the icon is 20px and the gap 4px: it lines up with the name) */
.lmStoreRow {
	display: block;
	width: 100%;
}
.lmRowNote {
	display: block;
	margin: -1px 0 2px 24px;
	line-height: 1.25;
}
.lmMerchant .lmIconRow,
.lmStore .lmIconRow {
	width: 100%;
	box-sizing: border-box;
}
.lmMerchant .lmIconRow > span:last-child:not(:first-child),
.lmStore .lmIconRow > span:last-child:not(:first-child) {
	margin-left: auto;
	text-align: right;
	white-space: nowrap;
}
.lmVx .lmIconRow {
	flex-wrap: wrap;
	align-items: flex-start;
}
.lmVx .lmIconRow {
	width: 100%;
	box-sizing: border-box;
}

.counter {
    font-variant: common-ligatures !important;
}

#idp.guidePopup .mb {
    width: min(1200px, 100%);
}

/* a trade: the item and its stock on the first line with the chapter it unlocks on the right, what it costs on the next line */
.lmVx .lmIconRow > .vxName {
	flex: 0 1 auto; /* the name and its stock; the chapter sits on the right of that line when it fits, else on the line below, still on the right */
	min-width: 0;
    display: flex;
    gap: 0px 4px;
    flex-wrap: wrap;
}
.lmVx .lmIconRow > .vxCh {
	margin-left: auto;
	text-align: right;
	white-space: nowrap;
}
.lmVx .lmIconRow > .vxCost {
	flex: 0 0 100%;
}
.vxMat {
	white-space: nowrap; /* a material and its amount stay together; the line breaks between materials */
}

.srcK {
	color: var(--mut);
	font-size: 0.92em;
	white-space: normal;
	font-weight: normal;
    letter-spacing: normal;
}

.locIc {
	height: 1em;
	width: 1em;
	object-fit: contain;
	vertical-align: text-bottom !important;
	margin-right: 3px;
}

/* a location link: the icon always on the left, the name (.locT) wraps beside it instead of being cut off */
a.loc {
	display: inline-flex;
	max-width: 100%;
	white-space: normal;
	overflow: visible;
	text-overflow: clip;
    vertical-align: text-bottom;
    align-items: center;
}

a.loc > .locIc {
	flex: none;
}

a.loc > .locT {
	min-width: 0;
	overflow-wrap: anywhere;
}

.lmPing {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 3px solid var(--text);
	box-shadow: 0 0 10px var(--glow-marker-on);
	transform: translate(-50%, -50%);
	animation: lmPing 1.2s ease-out 3 both;
	pointer-events: none;
}

.dropsContainer {
	display: flex;
	flex-wrap: wrap;
}

.dropsContainer > .idChip {
    min-width: calc(50% - 10px);
    box-sizing: border-box;
}

.lmPing2 {
	animation-delay: 0.4s;
}

@keyframes lmPing {
	0% {
		transform: translate(-50%, -50%) scale(1);
		opacity: 1;
	}
	100% {
		transform: translate(-50%, -50%) scale(3.4);
		opacity: 0;
	}
}

#lmk.finding .lmm:not(.hit):not(.on),
.lmm.wrongPath::before {
	filter: contrast(0.5);
}

.lmm.hit {
	z-index: 2;
	border-radius: 50%;
	box-shadow: 0 0 0 3px var(--glow-marker-hit), 0 0 0 6px var(--text);
	background-color: rgba(0, 0, 0, 0.35);
}

.lmm.off.hit {
	box-shadow: 0 0 0 2px #333, 0 0 0 4px #cfcdc7;
}

.lmSearch {
	position: relative;
	margin-left: auto;
	flex: 1;
	max-width: 400px;
	min-width: 150px;
}

.lmSearch input[type="search"] {
	max-width: none;
	width: 100%;
}


.foodLikers .ci.mi {
    margin: 0;
    margin-right: 4px;
    height: 1.2em;
    width: 1.2em;
    vertical-align: text-bottom;
}

#lmr {
	position: absolute;
	left: 0; /* (map.js showResults moves it left or right when it would leave the screen) */
	right: auto;
	width: max-content; /* as wide as the results need: at least the search box, at most 560px or the screen */
	min-width: 100%;
	max-width: min(560px, calc(100vw - 16px));
	box-sizing: border-box;
	top: 100%;
	z-index: 20;
	max-height: min(60vh, 420px);
	overflow: auto;
	background: var(--surface-modal);
	border: 2px solid var(--boxLine);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.lmRes {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	cursor: pointer;
	font-size: 15px;
}

.lmResName {
    min-width: 40%;
}

.lmRes.act,
.lmRes:hover {
	background: var(--surface-control-active);
}
/* (the site search: the character whose name is typed in full, highlighted first: Enter opens it, the arrows go on to the rows) */
#gsr .gsWhen { opacity: .75; } /* (a quest's or event's row: its time before the part of its name typed, app.js renderSiteSearch) */
#gsr .gsChars .tile.act { background: var(--surface-control-active); outline: 2px solid var(--text); outline-offset: -2px; }

.lmRes .lmResName {
	flex: 1;
}

.lmRes .lmIc,
.lmRes .locIc {
	height: 20px;
	width: 20px;
}

.lmNone {
	color: var(--mut);
	cursor: default;
}
/* .lmm.off: its look (contrast(0.3) brightness(1.1) saturate(1.5)) is baked into its icon, images/map/off/ (map.js pinClass): no filter, for phones */
/* fixed to the map's scale (--pinOff, map.js apply), whatever the category or selection */

.lmm.off.on {
	opacity: 1;
	box-shadow:
		0 0 0 2px var(--glow-marker-off),
		0 0 10px 3px var(--glow-marker-off-halo);
	outline: 2px dashed var(--text);
	outline-offset: 3px;
	background-color: rgba(0, 0, 0, 0.45);
}

.lmFind {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	padding: 6px 8px;
	margin: 4px 0 8px;
	border: 2px solid var(--boxLine);
    background: var(--surface-location-find);
    filter: drop-shadow(1px 1px 1px black);
}

.lmFindHead .lmIc {
    margin-top: -0.1em;
}

/* the search's icon, name and what it is: one block that takes the row and wraps inside, so the clear button stays beside it */
/* (lined up on the text's baseline: the ✕ sits on the name's first line, also when the name wraps; the icon centred on that line) */
.lmFind {
	align-items: baseline;
}
.lmFindHead {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 6px;
}
.lmFindHead > :not(b):not(.srcK) {
	align-self: center;
}

.lmLink,
.lmBack {
	text-decoration: none;
}

.lmBack {
    width: 100%;
}

.lmLink {
    flex-shrink: 0.1;
}

.lmFound .lmLink {
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}

.lmOffTab {
	opacity: 0.5;
}

.lmChestList .lmIc {
    width: 1em;
    height: 1em;
}

.lmLink.lmOffTab {
    color: var(--fg);
}

.lmOffTab img {
	filter: grayscale(1);
	opacity: 0.5;
}

#lmd mark {
	background: var(--border-control-active);
	color: inherit;
	padding: 0 2px;
}

summary a.loc {
	display: inline-flex;
}

.lmFindText {
	margin: 2px 0 0;
    white-space: pre-line;
}

.acqTrade .lmItem {
    vertical-align: baseline;
}

/* map list rows built by iconRow (map.js): the item link (icon inside it), then a note that wraps on its own */
.lmIconRow {
	display: flex;
	align-items: center;
	gap: 4px;
}
/* a quest's link in a map list row (an icon, then the name; the link is a block that clips its overflow, for the ellipsis): its icon (1.3em, lowered .25em) stuck up
   above the text and pushed the line down, and the name's descenders (the g of "Challenge") ended exactly on the clipped edge. The icon sits lower, so the text keeps its place, and
   the box has room under the line (padding, taken back by the margin: the row does not grow) */
.lmIconRow a.lmItem.qLink { padding-bottom: 3px; margin-bottom: -3px; }
.lmIconRow .qLink .si { vertical-align: -.35em; }
/* a long note (e.g. a trade's materials) wraps instead of running out of the panel; its links stay whole */
.lmIconRow,
.lmIconRow > span:not(.lmIconLink) {
	min-width: 0;
}
.lmIconRow .srcK {
	white-space: normal;
}
/* item links inside a note (a trade's materials): icon at the note's text size, on its line */
.lmIconRow .srcK .lmIconLink {
	gap: 4px;
    vertical-align: bottom;
}
.lmIconRow .srcK .lmIc {
	width: 1em;
	height: 1em;
}
/* an item link with its icon inside (map.js hl): the icon centred on the name, the name wrapping beside it */
.lmIconLink {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
.lmIconLink > img {
	flex: none;
}
a.lmIconLink:hover {
	text-decoration: none; /* a flex box doesn't pass it on: the name below gets it */
}
a.lmIconLink:hover > span {
	text-decoration: underline dotted;
}

.lmIconRow small {
	color: var(--mut);
}

.itemSource .lmItem,
.magicSource .lmItem {
  white-space: normal;
}

.scrollSources .si {
	margin-right: 2px;
    vertical-align: text-bottom;
}

.idSec .loc {
    color: var(--text);
}

/* ====================================================================== */
/* Item popup (#idp)                                                      */
/* ====================================================================== */

#idp,
#shp,
#spp {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 18;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px 8px;
	box-sizing: border-box;
}

#md,
#shp,
#cmp,
#lmp,
#idp,
#spp {
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}
/* the lists (#cmp) and the map (#lmp) fill the whole screen at every size: nothing of the page shows behind them, so no blur to draw (a backdrop-filter is costly,
   on a phone most of all). Not the Quests and the Calendar (modalWx / modalWy): their window has no background, the page shows in the gaps between their panes */
#cmp:not(.modalWx, .modalWy),
#lmp {
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}

#idp .mh {
    background: transparent;
    min-height: 37px;
    box-sizing: content-box;
    padding: 15px 0;
    margin: 0 15px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
}

body #idx {
    width: 32px;
    height: 32px;
    top: 17px;
    right: 2px;
}

#idx::before {
	inset: 0;
}

#idc>*:first-child {
    margin-top: 10px;
}

#idp {
	padding: calc(env(safe-area-inset-top, 0px) + 12px) 6px 12px;
}

#idp .mb {
	width: min(624px, 100%);
	min-width: min(360px, 100%);
	min-height: min(120px, 100%);
	max-height: 100%;
	height: auto;
	/* the frame: the game's info window (images/quests/window.webp), drawn by .mb::before (the popup window rules, near the end of this file); under it the window's
	   colour as a fallback (while the frame loads, or where it is see-through), 10px in from every side so the frame's ragged transparent edge stays clear */
	background: linear-gradient(var(--surface-panel-dark), var(--surface-panel-dark)) 8px 8px / calc(100% - 16px) calc(100% - 16px) no-repeat;
	isolation: isolate;
	padding: 0;
}
#idp .mb::before,
#idp .mb::after {
	content: none; /* (the old top and bottom pictures of .mb) */
}

.idHead {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	font-size: 18px;
    margin-right: 40px;
    margin-left: 5px;
}

.questPopup .idHead {
    margin-left: 0;
}

.idHead span {
	line-height: 1px;
}

.idHead span>* {
    line-height: normal;
}

.idHead .si,
.idHead .ci {
	height: 32px;
	width: 32px;
	margin: 0;
	object-fit: contain;
    filter: drop-shadow(0px 0px 3px rgba(0, 0, 0, 0.3));
}

/* a unit's class sprite (images/unit-icons: 32 x 32 pixel art): kept sharp when scaled; in the popup's head at twice its size */
.unitIc {
	image-rendering: pixelated;
    transform: scale(1.35);
}
.idHead .idUnitIcon {
	height: 32px;
	width: 32px;
	margin: 0;
	image-rendering: pixelated;
	filter: drop-shadow(0px 0px 3px rgba(0, 0, 0, 0.3));
}
/* a unit's drops in its popup: an item and its chance, side by side */
.idDrop {
	display: inline-block;
	margin: 0 10px 4px 0;
}

.idDrop .idChip {
    margin-right: 3px;
}

.idStats .idEff b {
	display: flex;
	gap: 2px;
	align-items: center;
}
.idStats .idEff img.ef {
    height: 1.6em;
    width: 1.6em;
    margin: auto;
}

.idHead small {
	color: var(--bCol);
	font-size: 13px;
    font-weight: normal;
}

.idHead h1 small {
	margin-left: 3px;
}

.idHead h1 {
    margin: 0;
    font-size: 1em;
    font-weight: bold;
    line-height: normal;
}

#idx,
#shx,
#sppX {
	--dim: calc(3.3 * var(--vw) + 1px);
	position: absolute;
	top: 0;
	right: 0;
	height: var(--dim);
	width: var(--dim);
	padding: 0;
	text-align: center;
}

#idc {
    overflow: auto;
    font-size: 15px;
    padding: 0 10px;
	padding-bottom: 10px;
}

.idStats {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 4px 0 8px;
}

.idStats span {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 48px;
	padding: 2px 4px;
	box-sizing: border-box;
    border: 2px solid var(--border-stat-chip);
    background: var(--surface-stat-chip);
    justify-content: center;
}

.skDet .idStats span {
	padding: 2px;
}

/* a unit's stats at the chosen level (app.js unitStatsHtml): the level buttons, then one row per difficulty; the table scrolls sideways on a narrow screen */
.unitStats .unitLvBar {
	padding-bottom: 4px;
}
.unitLvBar :is(a, button) {
    padding: 6px 8px;
}

.unitStatWrap {
	overflow-x: auto;
}
/* (a guide page's table beside a floating picture: when less than this is left beside it, below the picture instead of squeezed and scrolling) */
.tutPage .unitStatWrap { min-width: min(100%, 420px); }
/* (also the guides' tables, .idTbl: the enemy level ranges) */
.unitStatTbl,
.idTbl {
	border-collapse: collapse;
	margin: 2px 0 8px;
	font-variant-numeric: tabular-nums;
}
.unitStatTbl th,
.unitStatTbl td,
.idTbl th,
.idTbl td {
	padding: 2px 8px;
	text-align: center;
	border: 2px solid var(--border-stat-chip);
	background: var(--surface-stat-chip);
	white-space: nowrap;
}
.unitStatTbl thead th,
.idTbl thead th {
	font-weight: normal;
	opacity: 0.85;
}
/* a tutorial's numbers (guide-data.json, app.js guideDataHtml): the text columns to the left, wrapping */
.gdTbl .gdL {
	text-align: left;
	white-space: normal;
}
/* a guide section's chart (app.js guideChartHtml): one line in the quest accent, the grid and axes recessive, a dashed 100% line; the hover's crosshair, dot and tooltip */
.gdChart { position: relative; margin: 6px 0 4px; max-width: 640px; } /* (the svg scales with its width: no wider, its text the size of the page's) */
.gdChart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.gdChart .gcGrid { stroke: var(--line); stroke-width: 1; }
.gdChart .gcRef { stroke: var(--bCol); stroke-width: 1; stroke-dasharray: 4 4; opacity: .55; }
.gdChart .gcLine { fill: none; stroke: var(--accent-quest); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.gdChart .gcTick { fill: var(--bCol); font-size: 11px; }
.gdChart .gcAxis { fill: var(--bCol); font-size: 12px; }
.gdChart .gcCross { stroke: var(--bCol); stroke-width: 1; opacity: 0; }
.gdChart .gcDot { fill: var(--accent-quest); stroke: var(--surface-panel-dark); stroke-width: 2; opacity: 0; }
.gdChart.gcOn .gcCross { opacity: .5; }
.gdChart.gcOn .gcDot { opacity: 1; }
.gdChart .gcTip { position: absolute; z-index: 2; pointer-events: none; display: flex; flex-direction: column; padding: 4px 8px; font-size: 12px; line-height: 1.35; white-space: nowrap;
	color: var(--fg); background: var(--surface-panel-dark); border: 1px solid var(--border-control); border-radius: 4px; }
.gdChart .gcTip[hidden] { display: none; }
/* several lines: the categorical slots 1-4, dark steps (blue, orange, aqua, yellow; checked against the panel #091b1e: lightness band, chroma, colour-blind separation
   ΔE 11.1, contrast all pass); a legend over the chart, the swatches in the tooltip too; each line's name at its end in the text colour */
.gcLegend, .gdChart { --gc-s1: #338ced; --gc-s2: #e76624; --gc-s3: #00a888; --gc-s4: #d28e05; }
.gdChart .gcLine.gcS1, .gdChart .gcDot.gcS1 { stroke: var(--gc-s1); } .gdChart .gcDot.gcS1 { fill: var(--gc-s1); }
.gdChart .gcLine.gcS2, .gdChart .gcDot.gcS2 { stroke: var(--gc-s2); } .gdChart .gcDot.gcS2 { fill: var(--gc-s2); }
.gdChart .gcLine.gcS3, .gdChart .gcDot.gcS3 { stroke: var(--gc-s3); } .gdChart .gcDot.gcS3 { fill: var(--gc-s3); }
.gdChart .gcLine.gcS4, .gdChart .gcDot.gcS4 { stroke: var(--gc-s4); } .gdChart .gcDot.gcS4 { fill: var(--gc-s4); }
.gdChart .gcDot[class*="gcS"] { stroke: var(--surface-panel-dark); }
.gdChart .gcEnd { fill: var(--fg); }
.gcLegend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; font-size: 13px; color: var(--fg); }
.gcLegend span, .gdChart .gcTip span { display: inline-flex; align-items: center; gap: 6px; }
.gcLegend i, .gdChart .gcTip i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; flex: none; }
.gcLegend i.gcS1, .gcTip i.gcS1 { background: var(--gc-s1); } .gcLegend i.gcS2, .gcTip i.gcS2 { background: var(--gc-s2); }
.gcLegend i.gcS3, .gcTip i.gcS3 { background: var(--gc-s3); } .gcLegend i.gcS4, .gcTip i.gcS4 { background: var(--gc-s4); }
.gdMore > summary { cursor: pointer; margin: 2px 0 6px; color: var(--text); }
.gdMore > summary:hover { text-shadow: var(--glow); }
@media (max-width: 700px) { .gdChart .gcTick { font-size: 18px; } .gdChart .gcAxis { font-size: 19px; } } /* (a phone: the svg drawn at about 60%, its text drawn larger to stay readable; after the rules above) */
.gdTbl thead th {
	white-space: normal;
}

/* (a place's link in a guide table: whole words, not "S/mi/lin/g Stone" (a.loc's text may break anywhere elsewhere): its column at least its longest word) */
.gdTbl a.loc > .locT { overflow-wrap: normal; }
/* a list of numbers ("10 / 10 / 15 / 20 / ...", app.js guideDataHtml): wraps at its slashes, so the text column beside it keeps its width */
.gdTbl .gdS {
	white-space: normal;
	min-width: 5em;
}
.gdTbl tbody th {
	font-weight: normal;
	color: var(--fg);
}
.gdTbl td,
.gdTbl tbody th {
	vertical-align: top;
}
/* (characters by category, as icons) */
.gdChars .lrs { display: flex; flex-wrap: wrap; align-items: flex-start; }
.gdChars tbody th { vertical-align: middle; white-space: nowrap; }
.gdLine {
	display: block;
    margin: 1px 0;
}
/* a guide table of sentences (what a stat does, how it is worked out): left aligned, wrapping, the name column narrow */
.idTblText td {
	text-align: left;
	white-space: normal;
	min-width: 12em;
}
.idTblText tbody th {
	white-space: nowrap;
	vertical-align: top;
}
.unitStatTbl tbody th,
.idTbl tbody th {
	text-align: left;
}
/* the corner: the unit's icon at the chosen level */
.unitStatTbl th.unitStatIc {
	padding: 0 4px;
	opacity: 1;
}
.unitStatTbl th.unitStatIc img {
	display: block;
	width: 28px;
	height: 28px;
	margin: 0 auto;
}

.skDet .idStats {
    margin: 0;
	gap: 0 8px;
	margin-left: 8px;
}

@media screen and (max-width: 900px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) { /* (and the portrait layout at every width: it is laid out at 800 px, index.html scaleToFit) */
	.skDet .idStats {
		margin: 0;
		gap: 0 6px;
	}
}

.ab .skDet .idStats {
    margin-top: 4px;
    margin-bottom: -4px;
}

.idStats small {
	color: var(--bCol);
	font-size: 12px;
}

.idWeapons {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 4px 0 8px;
}

.idWeapon {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 2px 4px;
	border: 2px solid var(--border-control);
	background: var(--surface-control);
}

.idWeapon .idStats {
	margin: 0;
	gap: 2px;
}

.idWeapon .idStats span {
	border: 0;
	min-width: 26px;
}

.lmSec.lmRepair .divider {
    height: 0;
    border-bottom: 1px solid var(--line);
}

.idWeapon .si {
	float: left;
	width: 20px;
	height: 20px;
}

/* class / mount growths in the popup: the tables' small-screen cells, side by side */
.idGrowth {
	display: grid;
	margin: 4px 0 8px;
	grid-template-columns: repeat(auto-fit, minmax(2.66667em, 1fr));
	border: 0;
}
.idGrowth>span {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	padding: 3px 1px;
	line-height: 115%;
    flex-wrap: wrap;
}

.idGrowth small {
	color: var(--mut);
	font-size: 0.8em;
}
/* a mount's stats and growths at each bond level (app.js, its popup): the chosen level's row only (.mtBond[data-lv], its buttons) */
.mtBond .tierLinks { margin: 2px 0 0; }
/* (each button the game's bond heart of its level (images/ui/bond-1..5: the game's IconRelianceAnimal01-05, the level drawn in it), the height of a line of text) */
.mtBondBtn img { display: block; width: 2em; height: 2em; margin: -0.3em auto; }
.mtBond .mtBondLv { display: none; }
.mtBond[data-lv="1"] .mtBondLv[data-lv="1"],
.mtBond[data-lv="2"] .mtBondLv[data-lv="2"],
.mtBond[data-lv="3"] .mtBondLv[data-lv="3"],
.mtBond[data-lv="4"] .mtBondLv[data-lv="4"],
.mtBond[data-lv="5"] .mtBondLv[data-lv="5"] { display: block; }

.idSec .idGrowth>span {
    flex-grow: 1;
    padding-left: 2px;
    padding-right: 2px;
    max-width: 20%;
}
.idSec .idGrowth {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
}

/* class picker: weapon tabs (the Classes comparison tabs) between the title and the search; the header wraps when they don't fit */
#md .mh {
	flex-wrap: wrap;
}
#mtb {
	display: flex;
	flex-wrap: wrap;
	gap: 1px;
	justify-content: center;
	flex: 1 1 auto;
}
#mtb:empty {
	display: none;
}
#mtb a.pk {
	cursor: pointer;
	user-select: none;
}
@media screen and (max-width: 700px) {
	#mtb .pk.tabIc .tabT {
		display: none;
	}
	#mtb .pk.tabIc .si {
		height: 1.4em;
		width: 1.4em;
		margin-left: 0;
	}
}

.tabContainer td.gm::after {
    right: auto;
    top: auto;
    margin-top: 0.5em;
    border-right-width: 0.3em;
    border-left-width: 0.3em;
    border-bottom-width: 0.5em !important;
    margin-left: 3px;
}

/* ====================================================================== */
/* Screenshot share page (share.js)                                       */
/* ====================================================================== */

/* the skill screenshot page (share.js, /share-screenshots/): the skill list to tick, the screenshots and the Turnstile check */
#shp[hidden] {
	display: none;
}
#shp .mb {
	width: min(1100px, 100%);
	min-height: 0;
	max-height: min(90vh, 100%);
}
#shp #shq {
	margin-left: auto;
}
/* only the list scrolls: the intro above it and the send box below it stay in place */
#shp .mb {
	height: min(90vh, 100%);
}
#shc {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	padding: 4px calc(1 * var(--vw)) calc(1 * var(--vw));
}
#shl {
	flex: 1;
	min-height: 0;
	overflow: auto;
	border-bottom: 1px solid var(--line);
}
.shIntro {
	margin: 6px 0 10px;
	max-width: 70em;
}
.shList {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 4px 12px;
	margin: 6px 0 14px;
}
.shItem {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 6px;
	padding: 3px 4px;
	border-top: 1px solid var(--line);
	cursor: pointer;
	text-align: left;
}
.shItem input[type="checkbox"] {
	flex: none;
	width: auto;
	min-width: 0;
	margin: 0;
	padding: 0;
}
.shItem span {
	flex: 1;
	align-items: flex-start;
	overflow: hidden;
}
.shItem small {
	max-width: 100%;
}
.shItem b {
	font-weight: normal;
}
.shItem:hover {
	background: var(--surface-row-hover);
}
.shItem span {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.shItem small {
	opacity: 0.7;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.shItem .si {
	margin: 0;
	flex: none;
}
#shf {
	flex: none;
	padding: 8px 0 0;
}
.shRow {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin: 4px 0;
}
#sht:empty {
	display: none;
}
/* Add screenshots / Send: the game's button (the selected tab's end caps and middle, the right cap the left one mirrored) */
.pk.shBtn {
	--capW: 20px; /* (36px tall: the 20 x 36 cap at its size) */
	position: relative;
	z-index: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	min-width: 120px;
	padding: 0 calc(var(--capW) + 8px);
	border: 0;
	color: var(--text-control-active);
	font-size: 16px;
	letter-spacing: 0.04em;
	cursor: pointer;
	background: none;
}
/* (the halves of the pill, as the selected tab's) */
.pk.shBtn::before,
.pk.shBtn::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: calc(50% - 1px);
	background: url(../images/ui/PageTabTxt_KeyHelpFrm_Half.webp) left center / auto 100% no-repeat;
	z-index: -1;
	pointer-events: none;
}
.pk.shBtn::after {
	left: calc(50% - 1px);
	right: 0;
	transform: scaleX(-1);
}
.pk.shBtn:hover:not(:disabled),
.pk.shBtn:focus-visible {
	text-shadow: var(--glow);
	filter: brightness(1.12);
}
.pk.shSend {
	min-width: 160px;
	font-size: 17px;
}
.pk.shBtn:disabled {
	filter: grayscale(0.7) brightness(0.7);
	opacity: 0.7;
	cursor: default;
}
.shOk {
	color: var(--text-shop-ok);
}
.shBad {
	color: var(--text-danger);
}

.magicSource,
.artLearners {
    padding: 2px;
}

.magicSource .lrs {
    display: block;
}

.magicSource .lrs:not(:first-child) {
	margin-top: 2px;
}



@media screen and (max-width: 1000px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) { /* (and the portrait layout at every width: it is laid out at 800 px, index.html scaleToFit) */
	.compareButtons {
		width: 63%;
		left: 18.5%;
		transform: scaleX(0.95);
	}
}

@media screen and (max-width: 950px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) { /* (and the portrait layout at every width: it is laid out at 800 px, index.html scaleToFit) */
	.compareButtons {
		width: 67%;
		left: 16.5%;
		transform: scaleX(0.9);
	}
}

@media screen and (max-width: 900px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) { /* (and the portrait layout at every width: it is laid out at 800 px, index.html scaleToFit) */
	.compareButtons {
		width: 71%;
		left: 14.5%;
		transform: scaleX(0.85);
	}
}

@media screen and (max-width: 850px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) { /* (and the portrait layout at every width: it is laid out at 800 px, index.html scaleToFit) */
	.compareButtons {
		width: 75%;
		left: 12.5%;
		transform: scaleX(0.8);
	}
}

@media screen and (max-width: 800px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) { /* (and the portrait layout at every width: it is laid out at 800 px, index.html scaleToFit) */
	.compareButtons {
		width: 78%;
		left: 11%;
		transform: scaleX(0.77);
	}
}

@media screen and (max-width: 600px) {
	.idGrowth span {
		font-size: 12px;
	}
	.idGrowth small {
		font-size: 10px;
	}
}

.idReq {
	margin: 4px 0;
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
}

.idReq .sw {
    margin-right: -4px;
}

.idSec.idSec-skills .si {
    height: 1.5em;
    width: 1.5em;
}

.idReq small {
	color: var(--mut);
	margin-right: 4px;
}

.idText {
	margin: 6px 0;
	white-space: normal;
}

.idSec {
	margin: 10px 0 0;
	display: flow-root; /* a section's box narrows beside the map picture (.idMapShot) instead of running under it */
}

/* the section a link opened the popup for (data-focus): a glow that fades out */
.idSec.idFlash {
	animation: idFlash 1.8s ease-out;
}
@keyframes idFlash {
	0%,
	25% {
		background: var(--surface-pulse);
		box-shadow:
			0 0 0 4px var(--surface-pulse),
			0 0 14px var(--glow-pulse);
	}
	100% {
		background: transparent;
		box-shadow:
			0 0 0 4px transparent,
			0 0 14px transparent;
	}
}
@media (prefers-reduced-motion: reduce) {
	.idSec.idFlash {
		animation-duration: 3s;
		animation-timing-function: steps(1, end);
	}
}

.idSec h3 {
	font-size: 14px;
	font-weight: normal;
	color: var(--bCol);
	margin: 0 0 4px;
	border-bottom: 1px solid var(--line2);
}

.levelButton {
	border: 1px solid var(--line);
	background: rgba(0, 0, 0, 0.5);
	border-radius: 99em;
	width: fit-content;
	padding: 0.25em 0.6em;
	color: var(--textDark);
}

.levelButton b {
	color: var(--text);
}

.lmReqDesc {
    margin-top: -12px;
}

.levelButton.unusable {
	color: var(--mut);
	font-weight: bold;
}

small .idText .loc {
    color: var(--mut);
}

table.gambitArea td.x::before {
	content: "";
	background-color: var(--gambit-area-fill);
	border: 1px solid var(--gambit-area-border);
    width: 100%;
    height: 100%;
	box-sizing: border-box;
	display: block;
}

table.gambitArea td.o::before {
	content: "";
	background-color: var(--gambit-origin-fill);
	border: 1px solid rgba(0, 0, 0, 1);
    width: 10px;
    height: 10px;
    margin: 0px;
	box-sizing: border-box;
	border-radius: 99px;
	display: block;
}

.gambitSupport table.gambitArea td.x::before {
	background-color: var(--gambit-support-fill);
	border-color: var(--gambit-support-border);
}

.gambitDefense table.gambitArea td.x::before {
	background-color: var(--gambit-defense-fill);
	border-color: var(--gambit-defense-border);
}

.idChip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 2px 7px 2px 0;
}

.idList {
	list-style: none;
    padding-left: 0;
    margin: 0;
}

a.lmItem {
	text-decoration: none;
}

a.lmItem:hover {
	text-decoration: underline dotted;
}

.idLikedByMounts .ci.mi {
    width: 1.2em;
    height: 1.2em;
    margin-left: 0;
    margin-right: 4px;
}

.idLikedMountFood .idChip,
.idLikedByMounts .idChip {
    min-width: min(50% - 10px, 10em);
    box-sizing: border-box;
}

.idLikedMountFoodList {
    max-height: max(5em, 25vh);
    overflow: auto;
}

.tierSel {
    font-size: inherit;
    padding: 1px 2px;
    width: 4em;
    color: inherit;
    border: transparent;
    min-width: auto;
}

.boonCol {
	padding-left: 2px;
	padding-right: 2px;
	grid-column: span 3 !important;
}

@media screen and (max-width: 1250px) {
	.fv {
		display: none;
	}

	#bdb {
		font-size: 14px;
        padding-top: 2px;
        padding-bottom: 2px;
	}

	.sv {
		display: inline-block;
	}

	#cmp.modalfastest thead {
		display: table-header-group;
        position: sticky;
	}

	#cmp.modalfastest thead {
		display: table-header-group;
        position: sticky;
	}

	#cmp.modalfastest thead th:first-child {
		display: none;
	}

	#cmp.modalfastest tr {
		display: grid;
        align-items: start;
		grid-template-columns: repeat(4, 1fr);
		padding-top: 2px;
		padding-bottom: 2px;
	}
	
    #cmp.modalfastest tr {
        border-bottom: 0;
    }
	
    #cmp.modalfastest td {
        border: 0;
    }

	#cmp.modalfastest tbody th,
	#cmp.modalfastest tbody td[colspan] {
        grid-column: span 4;
	}

	#cmp.modalfastest td:not(td[colspan]) .recruitContainer > span {
		max-width: 100%;
	}
}

@media screen and (max-width: 1000px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) { /* (and the portrait layout at every width: it is laid out at 800 px, index.html scaleToFit) */
	.row {
		padding-left: 0;
	}
}

@media screen and (max-width: 1000px) and (max-aspect-ratio: 205 / 100) {
	/* Move the entire page to the left so it fits on the screen even as the right side starts getting cut off*/
	.wrapper {
		transform: scale(1.04);
		transform-origin: left center;
	}

	.wrap {
		transform-origin: left top;
		left: calc(-3 * var(--vw) * var(--scale));
	}

	.gsSearch {
		top: calc(var(--vw) * 1.5);
		left: 4%;
	}
}

@media screen and (max-width: 950px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) { /* (and the portrait layout at every width: it is laid out at 800 px, index.html scaleToFit) */
    .cardButtons {
        width: calc(61% + 0.66 * (950px - 100vw));
        transform: scaleX(calc(1 - (950px - 100vw) / 1000px));
        justify-content: flex-start;
        transform-origin: left center;
    }
}

@media screen and (max-width: 1000px) and (min-aspect-ratio: 205 / 100) {
	.sks {
        padding: calc(0.3 * var(--vw)) 0.8vw;
	}

	.ski .si {
		height: max(0.8em, calc(1.4 * var(--vw)));
		width: max(0.8em, calc(1.4 * var(--vw)));
	}

	.row:first-child {
		margin-bottom: -0.2em;
	}

	.row {
		padding-left: 0;
	}

    .cardButtons {
    	width: 67.5%;
        transform: scaleX(0.9);
        justify-content: flex-start;
        transform-origin: left center;
        letter-spacing: -1px;
    }

	#shc {
		flex-direction: row;
	}

	#shc > * {
		box-sizing: border-box;
		flex-basis: 33%;
	}
	
	#mainWrapper {
        font-size: 14px;
	}

	.wrapper {
		--wrapperScale: 1.15;
		transform: scale(var(--wrapperScale));
		--wrapperLeft: calc(16px * 6 / var(--wrapperScale));
		padding-left: calc(
			var(--wrapperLeft) + calc(50 * var(--vw)) * (var(--wrapperScale) - 1)
		);
		margin-top: calc(-1.2 * var(--vw));
		transform-origin: center;
	}

	section {
		padding-right: 4%;
	}

	.wrap {
		/*left: calc((100vw / 100vh - (185 / 100)) * 16px * 3.5 * 1.083 / var(--scale));*/ /* Center the wrapper as we are aligning left*/
		transform-origin: left top;
	}

	.gsSearch {
		left: calc(-1 * var(--wrapperLeft) / var(--scale) + 7px);
		top: calc(var(--vw) * 5.5);
		width: calc(
			var(--wrapperLeft) / var(--scale) + calc(2 * var(--vw) + 3.3vw) - 12px
		);
	}

	.compareButtons {
		left: calc(-1 * var(--wrapperLeft) / var(--scale) + 7px);
		width: calc(
			var(--wrapperLeft) / var(--scale) + calc(2 * var(--vw) + 3.3vw) - 12px
		);
		flex-direction: column;
        height: 87%;
		gap: 6px;
		top: calc(var(--vw) * 5.5);
		transform: none;
	}

	.compareButtons::before {
		content: "";
		min-height: 34px;
		flex-shrink: 0;
	}
	.compareButtons::after {
		content: "";
		flex: 1 1 0; /* Can grow, and can shrink all the way to 0 if space is needed */
		max-height: 34px;
	}

	.compareButtons > .pk {
        --bHeight: max(6.5vh, 1.65em);
		font-size: calc(11.5px / var(--scale));
		border: 0 !important;
		background: var(--surface-control);
		max-height: var(--bHeight);
		background: url(../images/buttonInactiveBG5.webp) !important;
		background-size: 100% 100% !important;
		text-shadow: none;
		filter: drop-shadow(0.1em 0.1em 0.1em rgba(0, 0, 0, 120));
		text-align: left;
        padding-left: 20%;
        width: 8.2em;
        margin-left: auto;
        margin-right: 0.5em;
        display: flex;
        align-items: center;
	}

	.compareButtons > .pk:hover,
	.compareButtons > .pk:focus {
		text-shadow: var(--glow);
	}
}

@media screen and (max-width: 1100px) {

	#cmc .itemDesc {
		display: none;
	}

	.pathSfx {
		display: none;
	}

.blaze-name {
    padding-top: 2px;
    padding-bottom: 0;
}
.blaze-kind {
    padding-bottom: 2px;
    padding-top: 0;
	color: var(--mut);
	font-size: 0.92em;
}

	#cmp .mh,
	#md .mh {
		background: url(../images/dividerT.webp);
    	filter: drop-shadow(1px 1px 0px var(--shadow-frame));
		background-repeat: no-repeat;
		background-size: calc(100% - 20px);
		background-position: bottom;
		margin-bottom: 0;
	}



	:is(#cmn, #mtb) .pk.tabIc {
        padding-left: 8px !important;
        padding-right: 8px !important;
	}

	:is(#cmn, #mtb) .pk.tabIc .si {
		margin-left: 0;
	}

	#mtb {
		gap: 6px;
	}

	.mb:before {
		background-image: url(../images/listBottom.webp);
		transform: scaleY(-1);
		background-position: bottom center;
	}

	#cmc thead {
		display: none;
	}
	#sortBar:not(:empty) {
		display: flex;
		flex-wrap: wrap;
		gap: 4px;
		justify-content: flex-end;
	}

	#cmp.modalgrowths .characterName ,
	#cmp.modalbasestats .characterName  {
        grid-column: span 24;
	}

	#cmp.modalgrowths .growthCol,
	#cmp.modalbasestats .growthCol {
        min-height: 40px;
        grid-column: span 6;
	}

	#cmp.modalfastest th:not(:empty):before {
		height: 100%;
	}

	#cmc tr {
		display: grid;
		grid-template-columns: repeat(48, 1fr);
        align-items: start;
		padding-top: 2px;
		padding-bottom: 2px;
		border-bottom: 1px solid var(--line);
	}
	
	#cmc tr td {
		height: 100%;
	}

	.collapseEmpty:empty {
		display: none;
	}

	#cmc thead > tr {
		padding-bottom: 0.7vw;
	}

	#cmc th:not(:empty):before {
		height: calc(100% - 0.55vw);
	}

	#cmc th {
		padding-bottom: 4px;
	}
	#cmc td.battalionRank {
        grid-column: span 5 !important;
	}
	#cmc td.battalionArea {
		grid-column: 30 / 37 !important;
		grid-row: 1 !important;
	}
	#cmc td.battalionGambit {
		grid-column: 21 / 30 !important;
		grid-row: 1 !important;
	}

	#cmc td.battalionLocation {
        grid-column: 37 / 61 !important;
        grid-row: 1 / 3 !important;
    }

	/* rows are grids here, so the cells are blocks: the fixed header height would cut the text (a table cell only grows) */
	#cmc tbody th {
		height: auto;
	}

	/* (:where keeps the exclusion from adding specificity: this rule must stay weaker than the column classes like .colRowFull) */
	#cmc table :where(table:not(.gambitArea)) tr > * {
		grid-column: span 6;
		max-width: none !important;
		width: auto !important;
	}

	#cmc tr > *.characterName {
		overflow: hidden;
		text-overflow: ellipsis;
	}

    #cmp.modalWr tr {
        border-bottom: 0;
    }

	#cmc tr > .weaponTrait {
		grid-column: span 4;
	}

	#cmc tr > .spellTrait,
	#cmc tr > .equipTrait {
		grid-column: span 4;
	}
	#cmc tr > .equipCost {
		grid-column: span 5;
	}
	/* equipment: the stats are one line under the name row (the cells stay for the sort buttons) */
	#cmc tr > .equipStat {
		display: none;
	}
	#cmc tr > td.equipDetail {
		display: block;
	}

	.weaponDescription,
	.magicDescription {
		padding-top: 0;
	}

	.classModal tr {
		display: flex;
		flex-wrap: wrap;
	}

	.classModal td {
		flex-basis: max(33.3%, min(50%, 200px));
	}

	.classModal td:empty {
		display: none;
	}

	#cmc tr:last-child {
		border-bottom-width: 0;
	}

	#cmc tr > td {
		border-width: 0;
		box-sizing: border-box;
	}
	#cmc tr > td:empty {
		padding: 0;
	}

	#cmc thead {
		position: relative;
	}

	#cmc tr > .col1 {
		grid-column: span 3;
	}

	#cmc tr > .col1plus {
		grid-column: span 4;
	}

	#cmc tr > .cols5 {
		grid-column: span 5;
	}

    #cmc tr > td.blaze-name {
        grid-column: span 15;
    }

    #cmp.modalblaze tr > .cols5 { /* (the six numbers: 7 each, 42, now that the crit is gone: the row is the character, type and name (42) and these) */
		grid-column: span 7;
        padding: 2px;
    }

	#cmc tr > .col2 {
		grid-column: span 6;
	}

	#cmc tr > .col3 {
		grid-column: span 9;
	}

	#cmp.modalWm tr > .likedFood {
		grid-column: span 3 !important;
	}

	.mountHeader,
	.likedFood {
		width: auto;
	}

	#cmp.modalWm tr > .mountName {
		grid-column: span 19;
	}

	#cmc tr > .cols10 {
		grid-column: span 10;
	}

	#cmc tr > .cols11 {
		grid-column: span 11;
	}

	#cmc tr > .col4 {
		grid-column: span 12;
	}

	#cmc tr > .col5 {
		grid-column: span 15;
	}

	#cmc tr > .col6 {
		grid-column: span 18;
	}

	#cmc tr > .cols19 {
		grid-column: span 19;
	}

	#cmc tr > .cols20 {
		grid-column: span 20;
	}

	#cmc tr > .col7 {
		grid-column: span 21;
	}

	#cmc tr > .col8 {
		grid-column: span 24;
	}

	#cmc tr > .col9 {
		grid-column: span 27;
	}

	#cmc tr > .col10 {
		grid-column: span 30;
	}

	#cmc tr > .col42 {
		grid-column: span 42;
	}

	#cmc tr > .newRow {
		grid-column: 1 / 7;
	}

	#cmc tr > .newRow.weaponTrait,
	#cmc tr > .newRow.spellTrait { /* (a trait that starts the row is as wide as the others: 4 columns, the .newRow above is 6) */
		grid-column: 1 / 5;
	}

	#cmc tr > .colHalf {
		grid-column: span 12;
	}

	#cmc tr > .colRow {
		grid-column: span 24;
	}

	#cmc tr > .colThirdRow {
		grid-column: span 36;
	}

	#cmc tr > .newRow.colHalf {
		grid-column: 1 / 13;
	}

	#cmc tr > .colRowFull {
		grid-column: span 48;
	}

	#cmc tr > .newRow.colRow {
		grid-column: 1 / 25;
	}

	#cmc tr > .newRow.colThirdRow {
		grid-column: 1 / 37;
	}

	#cmc .dmgT {
		display: none;
	}

	.tableSv .sv {
		display: inline-block;
	}
	#cmc tr .tableSv:not(.inline) {
		display: block;
	}
	#cmc tr .tableSv.inline {
		display: inline;
	}

	#cmc tr.halfRow {
		grid-template-columns: repeat(36, 1fr);
		width: 50%;
		display: inline-grid;
	}

	#cmp.modalWg tr {
		grid-template-columns: repeat(84, 1fr);
	}

	#cmc tr > .class-growth {
		grid-column: span 4;
	}

	#cmc tr > .class-total {
		grid-column: span 5;
	}

	#cmp.modalWg.modalabilities .col8 {
		grid-column: span 28;
	}

	#cmp.modalWc tr,
	#cmp.modalWm tr {
		grid-template-columns: repeat(60, 1fr);
	}

	/* class list: the license is 8 columns, its other 2 go to the skills */
	#cmp.modalWc tr > .classLicense {
		grid-column: span 8;
	}
	#cmp.modalWc tr > .class-skillList {
		grid-column: span 17;
	}

	#cmc .class-requirements {
		grid-column: 46 / 61 !important;
		grid-row: 1 !important;
	}

	#cmc tr > .mount-abilities {
		grid-column: span 20;
	}

	td.pl {
        max-width: none;
		width: auto;
	}

	#cmc .mount-location {
		grid-column: 37 / 61 !important;
		grid-row: 1 !important;
        max-width: none;
		width: auto;
	}

	#cmc tr > .art-trait {
		grid-column: span 4;
		padding-left: 2px;
		padding-right: 2px;
	}
	#cmc tr > .art-name {
		grid-column: span 18;
	}

	#cmc tr > .art-skill {
		grid-column: span 6;
		padding-left: 2px;
		padding-right: 2px;
	}

	#cmc tr > .blaze-effect {
		grid-column: span 51;
	}
	#cmc tr > .blaze-unlock {
		grid-column: span 21;
		text-align: right;
	}

	#cmc tr > .blaze-kind {
        grid-column: span 12;
	}
}

@media screen and (max-width: 1100px) and (min-width: 700px) {
	#cmp tr > .combatArt {
        grid-column: 25 / 34;
        grid-row: 1;
	}
	#cmp tr > .itemSource,
	#cmp tr > .magicSource {
        grid-column: 34 / 49;
        grid-row: 1 / 4;
		vertical-align: top;
        height: 100%;
	}
	#cmp tr > .weaponDescription {
    	grid-column: span 33;
	}
	/* magic: the 6 spell traits (4 columns each) and the description are 24 columns wide, the source gets the rest of the 48 */
	#cmp tr > .magicSource {
        grid-column: 25 / 49;
	}
	#cmp tr > .magicDescription {
    	grid-column: span 24;
	}
	/* blaze arts (84 columns): the character, the type icon and the six numbers (7 each) span rows 1 and 2; the name is on row 1 with its kind under it;
	   row 3 is the effect (63) and the unlock (21) */
	#cmp.modalblaze tr > .characterName {
		grid-column: 1 / 25;
		grid-row: 1 / 3;
	}
	#cmp.modalblaze tr > .col1 {
		grid-column: 25 / 28;
		grid-row: 1 / 3;
	}
	#cmp.modalblaze tr > .blaze-name {
		grid-column: 28 / 43;
		grid-row: 1;
	}
	#cmp.modalblaze tr > .blaze-kind {
		grid-column: 28 / 43;
		grid-row: 2;
	}
	#cmp.modalblaze tr > .cols5 {
		grid-row: 1 / 3;
	}
	#cmp.modalblaze tr > .cols5:nth-child(4) { grid-column: 43 / 50; }
	#cmp.modalblaze tr > .cols5:nth-child(5) { grid-column: 50 / 57; }
	#cmp.modalblaze tr > .cols5:nth-child(6) { grid-column: 57 / 64; }
	#cmp.modalblaze tr > .cols5:nth-child(7) { grid-column: 64 / 71; }
	#cmp.modalblaze tr > .cols5:nth-child(8) { grid-column: 71 / 78; }
	#cmp.modalblaze tr > .cols5:nth-child(9) { grid-column: 78 / 85; }
	#cmp.modalblaze tr > .blaze-effect {
		grid-column: 1 / 64;
		grid-row: 3;
	}
	#cmp.modalblaze tr > .blaze-unlock {
		grid-column: 64 / 85;
		grid-row: 3;
	}

	/* arts: 50 columns, half each. The left side is 25: row 1 the name (15), effective (4) and skill (6); row 2 the five stats (cost, might, hit, crit,
	   range) 5 each, each in its own place whether the others have a value or not; row 3 the effect. Who can use it (weapons / learned by) is the
	   other 25 columns at the right over the three rows */
	#cmp.modalWt tr {
		grid-template-columns: repeat(50, minmax(0, 1fr));
	}
	#cmp.modalWt tr > .art-name {
		grid-column: 1 / 16;
		grid-row: 1;
	}
	#cmp.modalWt tr > .eff {
		grid-column: 16 / 20 !important;
		grid-row: 1;
	}
	#cmp.modalWt tr > .art-skill {
		grid-column: 20 / 26;
		grid-row: 1;
	}
	#cmp.modalWt tr > .art-trait {
		grid-row: 2;
	}
	#cmp.modalWt tr > .art-trait:nth-child(4) { grid-column: 1 / 6; }
	#cmp.modalWt tr > .art-trait:nth-child(5) { grid-column: 6 / 11; }
	#cmp.modalWt tr > .art-trait:nth-child(6) { grid-column: 11 / 16; }
	#cmp.modalWt tr > .art-trait:nth-child(7) { grid-column: 16 / 21; }
	#cmp.modalWt tr > .art-trait:nth-child(8) { grid-column: 21 / 26; }
	#cmp.modalWt tr > .colRowFull {
		grid-column: 1 / 26;
		grid-row: 3;
	}
	#cmp.modalWt tr > .colRowFull:last-child {
		grid-column: 26 / 51;
		grid-row: 1 / 4;
	}

	/* mounts: 60 columns. The left side is 45 wide, the nine stat cells (the stats and the total, empty ones keep their place) 5 each. First row: the
	   icon (3), name (14), liked food (3), liked taste (8) and the mount skills (17); the sources in the 15 columns after them over both rows */
	#cmp.modalWm tr > .mountHeader {
		grid-column: 1 / 3;
		grid-row: 1;
	}
	#cmp.modalWm tr > .mountName {
		grid-column: 3 / 18;
		grid-row: 1;
	}
	#cmp.modalWm tr > .likedFood {
		grid-column: 18 / 21;
		grid-row: 1;
	}
	#cmp.modalWm tr > .col3:not(.likedFood) {
		grid-column: 21 / 29;
		grid-row: 1;
	}
	#cmp.modalWm tr > .mount-abilities {
		grid-column: 29 / 46;
		grid-row: 1;
	}
	#cmp.modalWm tr > .class-growth {
		grid-column: span 5;
	}
	#cmc td.mount-location {
		grid-column: 46 / 61 !important;
		grid-row: 1 / 3 !important;
	}

	/* weapons (not magic): equal columns (a 1fr column grows with its content), 52 of them: the left side is 35 wide so the seven traits (the six
	   and the curse) are 5 each, and the sources are the 17 after it. First row: the name (20), effective (4), skill (6) and the cost (5, last in
	   the row but placed at its end); third row: the description with the combat art at its right (the description has the whole row without one) */
	#cmp.modalWw:not(.modalWk) tr {
		grid-template-columns: repeat(52, minmax(0, 1fr));
	}
	#cmp.modalWw:not(.modalWk) tr > .nameField {
		grid-column: span 20;
	}
	#cmp.modalWw:not(.modalWk) tr > .weaponTrait {
		grid-column: span 5;
	}
	#cmp.modalWw:not(.modalWk) tr > .newRow.weaponTrait {
		grid-column: 1 / 6;
	}
	#cmp.modalWw:not(.modalWk) tr > .weaponCost {
		grid-column: 31 / 36;
		grid-row: 1;
	}
	#cmp.modalWw:not(.modalWk) tr > .weaponDescription {
		grid-column: 1 / 21;
		grid-row: 3;
	}
	#cmp.modalWw:not(.modalWk) tr > .combatArt {
		grid-column: 21 / 36;
		grid-row: 3;
	}
	#cmp.modalWw:not(.modalWk) tr:has(> .combatArt:empty) > .weaponDescription {
		grid-column: 1 / 36;
	}
	#cmp.modalWw:not(.modalWk) tr > .itemSource {
		grid-column: 36 / 53;
		grid-row: 1 / 4;
	}
	/* the characters' abilities: the character on the left, the equippable abilities and arts next to it, both over all the rows, and the
	   personal ability, bloodmark, blaze ability and blaze art stacked in the last column (the blaze ability above the blaze art) */
	#cmp.modalWg.modalabilities tr > .characterName {
		grid-column: 1 / 29;
		grid-row: 1 / span 4;
	}
	#cmp.modalWg.modalabilities tr > .abEquip {
		grid-column: 29 / 57;
		grid-row: 1 / span 4;
	}
	#cmp.modalWg.modalabilities tr > .abPersonal { grid-column: 57 / 85; grid-row: 1; }
	#cmp.modalWg.modalabilities tr > .abCrest { grid-column: 57 / 85; grid-row: 2; }
	#cmp.modalWg.modalabilities tr > .abBlazeAbility { grid-column: 57 / 85; grid-row: 3; }
	#cmp.modalWg.modalabilities tr > .abBlazeArt { grid-column: 57 / 85; grid-row: 4; }
	/* abilities: two halves of 24 columns: the name and skill on the left with the effect under them, who learns it on the right over both rows */
	#cmp.modalWa tr > .art-name {
		grid-column: 1 / 19;
		grid-row: 1;
	}
	#cmp.modalWa tr > .art-skill {
		grid-column: 19 / 25;
		grid-row: 1;
	}
	#cmp.modalWa tr > .colRowFull {
		grid-column: 1 / 25;
		grid-row: 2;
	}
	#cmp.modalWa tr > .colRowFull.artLearners {
		grid-column: 25 / 49;
		grid-row: 1 / 3;
	}
	/* equipment: the name and, under it, the stats line (24 columns); weight (4) and cost (5) beside them over both rows, so the two rows are 33 wide as the weapons' (the source starts after them) */
	#cmp.modalWe tr > .equipName {
		grid-column: 1 / 25;
		grid-row: 1;
	}
	#cmp.modalWe tr > .equipDetail {
		grid-column: 1 / 25;
		grid-row: 2;
	}
	#cmp.modalWe tr > .equipTrait {
		grid-column: 30 / 34;
		grid-row: 1 / 3;
		align-self: center;
	}
	#cmp.modalWe tr > .equipCost {
		grid-column: 25 / 30;
	}

	#cmc tr > .nameField {
		grid-column: span 14;
	}

	#cmc tr > .skill {
		grid-column: span 6;
		padding-left: 2px;
		padding-right: 2px;
	}

	#cmc tr > .eff {
		grid-column: span 4 !important;
	}
}

/* the growths and base stats tables between 901 and 1100px: one row, the name and the 11 stat cells (the stats, Total, Weighted) */
@media screen and (min-width: 901px) and (max-width: 1100px) {
	:is(#cmp.modalgrowths, #cmp.modalbasestats) #cmc tr {
		grid-template-columns: repeat(60, 1fr);
	}

	:is(#cmp.modalgrowths, #cmp.modalbasestats) #cmc tr > .characterName {
		grid-column: span 16;
	}

	:is(#cmp.modalgrowths, #cmp.modalbasestats) #cmc tr > .growthCol {
		grid-column: span 4;
	}
}

@media screen and (max-width: 900px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) { /* (and the portrait layout at every width: it is laid out at 800 px, index.html scaleToFit) */
	/* the Weighted column of the growths and base stats tables (shown above 900px) */
	.weightedCol {
		display: none !important;
	}

	#mainWrapper::before {
		content: "";
		background-image: url(../images/bgLineCover4.webp);
		background-size: 100%;
		width: 100%;
		height: 100%;
		left: 0;
		top: 0;
		position: absolute;
	}
}

@media screen and (max-width: 700px) {
	.recruitContainer > span {
		max-width: none;
		flex-basis: max(15em, 50% - 5px);
		width: auto;
	}

	#cmc tr {
		grid-template-columns: repeat(36, 1fr);
	}

	#cmc tr > .colRow,
	#cmc tr > .colThirdRow,
	#cmc tr > .colRowFull {
		grid-column: span 36;
	}

	#cmc tr > .newRow.colHalf {
		grid-column: 1 / 19;
	}

	#cmc tr > .newRow.colRow,
	#cmc tr > .newRow.colThirdRow {
		grid-column: 1 / 37;
	}

	#cmc tr.halfRow {
		width: 100%;
	}

	#cmp.modalWg tr {
		grid-template-columns: repeat(42, 1fr);
	}

	#cmp.modalWg.modalabilities .col8 {
		grid-column: span 42;
	}

	#cmp.modalWc tr {
		grid-template-columns: repeat(30, 1fr);
	}

	/* weapons & magic and scrolls: 32 columns, so the traits (4 columns each, Might too: it starts the row) fill whole rows
       (8 weapon traits = 32) */
	#cmp.modalWw tr,
	#cmp.modalscrolls tr {
		grid-template-columns: repeat(32, 1fr);
	}
	#cmp.modalWw tr > .newRow.weaponTrait,
	#cmp.modalscrolls tr > .newRow.weaponTrait {
		grid-column: 1 / 5;
	}
	/* weapons (not magic): 30 columns, in fixed rows. 1: the name (18), effective (4) and skill (8); 2: the six traits (4 each, the durability 6) and the curse (4);
	   3: the combat art (23) with the cost (7) at its end, which keeps its place without either; then the description and the sources */
	#cmp.modalWw:not(.modalWk) tr {
		grid-template-columns: repeat(30, 1fr);
	}
	#cmp.modalWw:not(.modalWk) tr > .nameField {
		grid-column: span 18;
	}
	#cmp.modalWw:not(.modalWk) tr > .skill {
		grid-column: span 8;
	}
	#cmp.modalWw:not(.modalWk) tr > .weaponTrait {
		grid-column: span 4;
	}
	#cmp.modalWw:not(.modalWk) tr > .newRow.weaponTrait {
		grid-column: 1 / 5;
	}
	#cmp.modalWw:not(.modalWk) tr > .weaponDur {
		grid-column: span 6;
	}
	#cmp.modalWw:not(.modalWk) tr > .weaponCurse {
		grid-column: span 4;
	}
	#cmp.modalWw:not(.modalWk) tr > .colRow,
	#cmp.modalWw:not(.modalWk) tr > .colThirdRow,
	#cmp.modalWw:not(.modalWk) tr > .colRowFull {
		grid-column: span 30;
	}
	#cmp.modalWw:not(.modalWk) tr > .newRow.colRow,
	#cmp.modalWw:not(.modalWk) tr > .newRow.colThirdRow {
		grid-column: 1 / 31;
	}
	#cmp.modalWw:not(.modalWk) tr > .combatArt {
		grid-column: 1 / 24;
		grid-row: 3;
	}
	#cmp.modalWw:not(.modalWk) tr > .weaponCost {
		grid-column: 24 / 31;
		grid-row: 3;
	}
	/* items with a flavor (fish, meat, vegetables, ...): name and flavor on one row, 27 + 9 = 36 */
	#cmc tr:has(> .itemFlavor) > .col10 {
		grid-column: span 27;
	}

	/* name, effective and skill requirement on one row: 20 + 4 + 8 = 32 (the 36 column spans were 18 + 6 + 12) */
	#cmp.modalWw tr > .nameField {
		grid-column: span 20;
	}
	#cmp.modalWw tr > .eff {
		grid-column: span 4;
	}
	#cmp.modalWw tr > .skill {
		grid-column: span 8;
	}
	#cmp.modalWw tr > .colRow,
	#cmp.modalWw tr > .colThirdRow,
	#cmp.modalWw tr > .colRowFull,
	#cmp.modalscrolls tr > .colRow,
	#cmp.modalscrolls tr > .colThirdRow,
	#cmp.modalscrolls tr > .colRowFull {
		grid-column: span 32;
	}
	
	#cmp.modalboons tr > .colRowFull {
		grid-column: span 42;
	}

	#cmp.modalWw tr > .newRow.colHalf,
	#cmp.modalscrolls tr > .newRow.colHalf {
		grid-column: 1 / 17;
	}
	#cmp.modalWw tr > .newRow.colRow,
	#cmp.modalWw tr > .newRow.colThirdRow,
	#cmp.modalscrolls tr > .newRow.colRow,
	#cmp.modalscrolls tr > .newRow.colThirdRow {
		grid-column: 1 / 33;
	}

	/* magic: 30 columns, the 6 spell traits (Might, Hit, Crit, Range, Uses, Weight) 5 columns each; name 18 + effective 4 + skill 8 = 30 */
	#cmp.modalWk tr {
		grid-template-columns: repeat(30, 1fr);
	}
	#cmp.modalWk tr > .spellTrait {
		grid-column: span 5;
	}
	#cmp.modalWk tr > .newRow.spellTrait {
		grid-column: 1 / 6;
	}
	#cmp.modalWk tr > .nameField {
		grid-column: span 18;
	}
	#cmp.modalWk tr > .colRow,
	#cmp.modalWk tr > .colThirdRow,
	#cmp.modalWk tr > .colRowFull {
		grid-column: span 30;
	}
	#cmp.modalWk tr > .newRow.colHalf {
		grid-column: 1 / 16;
	}
	#cmp.modalWk tr > .newRow.colRow,
	#cmp.modalWk tr > .newRow.colThirdRow {
		grid-column: 1 / 31;
	}

	/* equipment: 30 columns; the name and, under it, the stats line are 19 wide, weight (5) and cost (6) beside them over both rows */
	#cmp.modalWe tr {
		grid-template-columns: repeat(30, 1fr);
	}
	/* (before the cells' own places: the stats line and the source are colRowFull too, and the later rule wins) */
	#cmp.modalWe tr > .colRow,
	#cmp.modalWe tr > .colThirdRow,
	#cmp.modalWe tr > .colRowFull {
		grid-column: span 30;
	}
	#cmp.modalWe tr > .equipName {
		grid-column: 1 / 20;
		grid-row: 1;
	}
	#cmp.modalWe tr > .equipDetail {
		grid-column: 1 / 20;
		grid-row: 2;
	}
	#cmp.modalWe tr > .equipTrait {
		grid-column: 26 / 31;
		grid-row: 1 / 3;
		align-self: center;
	}
	#cmp.modalWe tr > .equipCost {
		grid-column: 20 / 26;
	}

	/* mounts: 36 columns, so the nine stat cells (the stats and the total) are 4 each: the first row is the icon (3), name (17), liked food (4)
	   and liked taste (12), then the stats, then the mount skills and the sources side by side, 18 each */
	#cmp.modalWm tr {
		grid-template-columns: repeat(36, minmax(0, 1fr));
	}

	#cmp.modalWm tr > .col3 {
		grid-column: span 12;
	}
	#cmp.modalWm tr > .col3.likedFood {
		grid-column: span 3 !important; /* (the one before, in the 1100 px rules, is important too) */
	}

	#cmp.modalWm tr > td.col3 {
		padding: 4px 2px;
	}

	#cmp.modalWm tr > .mountName {
        grid-column: span 18;
	}

	#cmc .mount-location {
		grid-column: span 18 !important;
		grid-row: auto !important;
        padding: 2px 0px;
	}

	#cmc tr > .mount-abilities {
        max-width: none;
		width: auto;
		grid-column: span 18;
	}

	#cmc tr > .class-growth {
		grid-column: span 4;
	}
	#cmp.modalWm tr > td.class-growth {
		grid-column: span 4; /* (not the 3 of the class lists) */
	}

	#cmc tr > td.class-growth {
		grid-column: span 3;
		font-size: 12px;
		line-height: 100%;
	}

	#cmc tr > .class-mov {
		grid-column: span 4;
	}

	#cmc tr > td.class-mov {
		font-size: 1em;
	}

	/* class list: Mov is on the right of the name row and the skills row (4 columns, two rows), so those two share the other 26 */
	#cmp.modalWc tr > .class-mov {
		grid-column: 27 / 31;
		grid-row: 1 / 3;
		align-self: center;
	}
	#cmp.modalWc tr > .classNameField {
		grid-column: span 18;
	}
	#cmp.modalWc tr > .classLicense {
		grid-column: span 8;
	}
	#cmp.modalWc tr > .class-skillList {
		grid-column: span 26;
	}

	#cmc .class-requirements {
		grid-column: span 15 !important;
		grid-row: auto !important;
	}

	#cmc tr > .class-skillList {
		grid-column: span 27;
	}

	#cmc tr > .blaze-effect {
        grid-column: span 42;
        grid-row: 4;
	}

	#cmc tr > .blaze-character {
		grid-column: 1 / 15 !important;
		grid-row: 4;
		text-align: right;
		padding: 0;
	}

	#cmc tr > .blaze-kind {
        grid-column: span 21;
	}

    #cmp.modalblaze tr > .cols5 { /* (the six numbers: 7 each, 42, the whole width of their row) */
        grid-column: span 7;
        padding: 2px;
    }
	/* blaze arts (42 columns): the character (20) and the type icon (3) span rows 1 and 2, the name (19) is beside them with its kind under it; row 3 the six
	   numbers (7 each), row 4 the effect (28, two thirds) and the unlock (14) */
	#cmp.modalblaze tr > .characterName {
		grid-column: 1 / 21;
		grid-row: 1 / 3;
	}
	#cmp.modalblaze tr > .col1 {
		grid-column: 21 / 24;
		grid-row: 1 / 3;
	}
	#cmp.modalblaze tr > .blaze-name {
		grid-column: 24 / 43;
		grid-row: 1;
	}
	#cmp.modalblaze tr > .blaze-kind {
		grid-column: 24 / 43;
		grid-row: 2;
	}
	#cmp.modalblaze tr > .cols5 {
		grid-row: 3;
	}
	#cmp.modalblaze tr > .cols5:nth-child(4) { grid-column: 1 / 8; }
	#cmp.modalblaze tr > .cols5:nth-child(5) { grid-column: 8 / 15; }
	#cmp.modalblaze tr > .cols5:nth-child(6) { grid-column: 15 / 22; }
	#cmp.modalblaze tr > .cols5:nth-child(7) { grid-column: 22 / 29; }
	#cmp.modalblaze tr > .cols5:nth-child(8) { grid-column: 29 / 36; }
	#cmp.modalblaze tr > .cols5:nth-child(9) { grid-column: 36 / 43; }
	#cmp.modalblaze tr > .blaze-effect {
		grid-column: 1 / 29;
		grid-row: 4;
	}
	#cmp.modalblaze tr > .blaze-unlock {
		grid-column: 29 / 43;
		grid-row: 4;
	}

	#cmc tr > .art-trait {
		grid-column: span 6;
	}

	#cmc tr > .art-name {
		grid-column: span 30;
	}
	/* arts: 30 columns, so both rows fill the width: the name (20), effective (4) and skill (6), then the five traits (cost, might, hit, crit, range) 6 each */
	#cmp.modalWt tr {
		grid-template-columns: repeat(30, minmax(0, 1fr));
	}
	#cmp.modalWt tr > .art-name {
		grid-column: span 23;
	}
	#cmp.modalWt tr > .art-skill,
	#cmp.modalWt tr > .art-trait {
		grid-column: span 6;
	}
	#cmp.modalWt tr > .colRow,
	#cmp.modalWt tr > .colThirdRow,
	#cmp.modalWt tr > .colRowFull {
		grid-column: span 30;
	}

	#cmc td.battalionName {
        grid-column: span 17 !important;
        max-width: none;
	}

	#cmp.modalWb td.class-growth {
        grid-column: span 4 !important;
        grid-row: 3 !important;
	}

	#cmc td.battalionRank {
        grid-column: span 6 !important;
	}
	#cmc td.battalionGambit {
        grid-column: 1 / 13 !important;
        grid-row: 2 !important;
	}
	#cmp.modalWb table.gambitArea {
		margin-left: auto;
	}

	#cmc td.battalionArea {
		grid-column: 13 / 24 !important;
        grid-row: 2 !important;
	}

	#cmc td.battalionLocation {
        grid-column: 24 / 37 !important;
        grid-row: 1 / 3 !important;
    }
}

@media screen and (max-width: 1100px) and (orientation: portrait) {
	.wrapper {
		transform: scale(1.1);
		transform-origin: left center;
	}

	#mainWrapper::before {
		display: none;
	}

	section {
		padding-right: 6.3%;
	}

    .cardButtons {
        width: 70%;
        justify-content: flex-start;
        transform: scaleX(0.83);
        transform-origin: left center;
    }
}

@media screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) {
	.notMobilePortrait {
		display: none;
	}

	

	.tg {
		grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
	}

	.gsSearch {
        left: 6%;
        top: calc(var(--vw) * 1.5);
        width: 27.5%;
	}
	
	.pk {
		box-sizing: border-box;
		padding: 0.5vw 2vw;
		color: var(--text);
		font: inherit;
		text-align: left;
		cursor: pointer;
		pointer-events: all;
	}

	#lineCover {
		display: none !important;
	}

	.mainWrapper {
		padding-top: calc(var(--vw) * 5.9);
		font-size: min(14px, 1em);
	}

	.singleColumn .mainWrapper {
		padding-top: calc(var(--vw) * 12.5);
	}

	.singleColumn.tab-liked-gifts .mainWrapper,
	.singleColumn.tab-recruitment .mainWrapper,
	.singleColumn.tab-profile .mainWrapper {
		padding-top: calc(var(--vw) * 6.5);
	}

	.singleColumn.builder:not(.splitColumns) .mainWrapper {
        padding-top: calc(var(--vw) * 6.2);
	}

	.singleColumn.builder .tabContainer > *:first-child {
		margin-top: 0;
	}

	.wrapper {
		transform: scale(1.6);
	}

	/* (the compare buttons sit above the card: the page moves down by half their room, --cbSpace from index.html scaleToFit, at the page's scale, so it is centred
	   with them; not a padding, which would move what is placed in it) */
	.wrap {
		--cbCentre: 1; /* (scaleToFit measures the buttons' room only where this is set: this layout) */
		left: calc(-5.2 * var(--vw) * var(--scale));
		top: calc(50% + var(--cbSpace, 0px) * var(--scale, 1) / 2);
	}

	.tabContainer {
		margin-left: calc(30 * var(--vw));
		width: calc(100% - 30 * var(--vw));
	}

	.singleColumn .tabContainer {
		margin-left: 0;
		width: 100%;
        z-index: 1;
        padding-left: 16px;
        --tcPadR: 16px;
	}

	/* the background is on the part that scrolls (.tabMain) when the tab has one, else on the tab itself */
	.singleColumn:not(.builder) .tabContainer:not(:has(> .tabMain)),
	.singleColumn:not(.builder) .tabContainer > .tabMain {
        background: var(--surface-page);
	}

	.singleColumn .tabContainer .tabFixed {
		min-height: calc(var(--vw) * 6);
		margin: 0;
		padding-top: 12px;
		padding-left: calc(var(--vw) * 29);
		box-sizing: border-box;
        z-index: 1;
	}

	.singleColumn .tabContainer .tabMain {
		padding-top: 16px;
	}

	/* (the Part I / Part III buttons are above the scrolling part now: in the flow, not fixed over it, and the gifts need no room under them) */
	.singleColumn:not(.builder) .tabContainer > .tabFixed.tierLinks {
		position: static;
		padding-top: 0;
		padding-bottom: 0;
    	align-items: center;
	}

	.singleColumn .tabContainer .scGrid {
		margin-left: 50%;
    	justify-content: space-between;
	}

	.singleColumn .tabContainer .scCell {
    	flex-basis: 25%;
		gap: 0px;
	}

	.singleColumn .tabContainer .scIn {
		height: 25px;
	}

	.singleColumn .tabContainer .scStep {
		height: 12px;
	}

	.singleColumn .tabContainer .scCell:first-child {
    	flex-basis: 50%;
	}
	
	.singleColumn .tabContainer .scCell:first-child .scLine {
		margin-right: auto;
		margin-left: 4px;
		gap: 10px;
	}

	.grid2 {
		margin-top: calc(var(--vw) * 24);
	}
	.grid2 > *:first-child {
		padding-top: 0;
	}

	/* the frame in three pieces (1800 wide): the top (658 high) and the bottom (440) at their own size, the center (272 high) repeated between them in ::before.
	   The height follows the screen: square on a 3 / 5 screen (what it was made for), taller in proportion on a taller one (--screenRatio: the screen's height / width,
	   index.html scaleToFit); never less than the top and the bottom together */
	section {
		background-image: url(../images/background-4-3-6-top.webp), url(../images/background-4-3-6-bottom.webp);
		background-size: 100% auto, 100% auto;
		background-position: left top, left bottom;
		background-repeat: no-repeat;
		padding-right: 32.5%;
		padding-top: calc(6.7 * var(--vw));
		aspect-ratio: auto;
		height: calc(100 * var(--vw) * 3 / 5 * var(--screenRatio, 5 / 3) * 0.95);
		min-height: calc(100 * var(--vw) * (658 + 440) / 1800);
		padding-left: 5%;
        padding-bottom: 2.5%;
	}
	section::before {
		content: "";
		position: absolute;
		z-index: -1;
		pointer-events: none;
		left: 0;
		width: 100%;
		/* (from the width, as the pieces scale with it: the section is 100 --vw wide; a pixel into the top and the bottom piece each, so no seam shows) */
		top: calc(100 * var(--vw) * 658 / 1800 - 1px);
		bottom: calc(100 * var(--vw) * 440 / 1800 - 1px);
		background: url(../images/background-4-3-6-center.webp) left top / 100% auto repeat-y;
	}

	.cardButtons {
        left: 34.5%;
		top: calc(2.2 * var(--vw));
        width: 33.2%;
		margin-top: 0;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 4px 0;
        transform: none;
	}

	/* (their height in the layout's unit (23 px at 800 px wide), so on a wider portrait screen (a tablet) they keep their share of the frame; the text keeps its size) */
	.cardButtons > .pk {
		height: calc(2.875 * var(--vw));
		line-height: calc(2.875 * var(--vw));
		--tabDiamond: calc(2.875 * var(--vw) * 55 / 92); /* (the open tab's diamonds: 55 / 92 of its height) */
        min-width: calc(50% - 2px);
        flex: 0;
	}

	#lt > .sk:first-child {
		margin-top: 6px;
	}

	.compareButtons {
		gap: 6px;
		transform: translateY(-87%);
		flex-wrap: wrap-reverse;
        left: 5.5%;
        width: 61.8%;
		top: calc(-0.8 * var(--vw));
	}

    .compareButtons > .pk {
        font-size: 14.5px;
        border: 0 !important;
        background: url(../images/buttonInactiveBG5.webp) !important;
        background-size: 100% 100% !important;
        text-shadow: none;
        line-height: 1.45em;
        padding: 0;
        flex-grow: 0;
        aspect-ratio: 4.4 / 1;
        height: calc(2.63 * var(--vw)); /* (21 px at 800 px wide, in the layout's unit: the buttons widen with their row, five to a row at any width) */
        filter: drop-shadow(0.1em 0.1em 0.1em rgba(0, 0, 0, 120));
        display: flex;
        justify-content: center;
        align-items: center;
    }

	.compareButtons > .pk:hover,
	.compareButtons > .pk:focus {
		text-shadow: var(--glow);
	}

	/* the buttons' order here: Characters, Classes, Abilities, Arts, Map / Weapons, Magic, Mounts, Battalions, Database */
	#cgb { order: 1; } #clb { order: 2; } #cab { order: 3; } #car { order: 4; } #mpb { order: 5; }
	#cwb { order: 6; } #cmb { order: 7; } #mnb { order: 8; } #bttb { order: 9; } #gfb { order: 10; }
}

@media screen and (max-width: 500px) {
	.recruitContainer > span {
		flex-basis: 100%;
	}
} /* drag and drop on the screenshot page: a dashed frame and a label over the box while files are dragged over it */
.shDrop {
	display: none;
}
#shp .mb.shOver .shDrop {
	display: flex;
	position: absolute;
	inset: 8px;
	z-index: 5;
	align-items: center;
	justify-content: center;
	border: 2px dashed var(--text);
	background: var(--surface-drop-overlay);
	color: var(--text-control-active);
	font-size: 22px;
	letter-spacing: 0.04em;
	pointer-events: none;
}
/* the class / mount popup's Select button (the game button, .shBtn) */
.idSelect {
    margin-left: auto;
}

.modalWt .lmClass,
.idReq .lmClass {
    margin-top: 4px;
    margin-bottom: 4px;
    margin-right: 4px;
    display: inline-block;
    overflow: visible;
    vertical-align: baseline;
}

/* ====================================================================== */
/* Spoiler blur & Part II / III question                                  */
/* ====================================================================== */

/* Part II / III spoilers (app.js tagSpoilers): blurred until that part is enabled; not inside an item popup a link opened */
/* the blur is an overlay inside the element (backdrop-filter), so it stays within its box; a row is blurred cell by cell */
html:not(.sp2) [data-spoil="2"]:not(tr),
html:not(.sp3) [data-spoil="3"]:not(tr),
html:not(.sw2) [data-spoil="12"]:not(tr),
html:not(.sw3) [data-spoil="13"]:not(tr) {
	position: relative;
	cursor: pointer;
}
/* (a hidden quest row: no tooltips of what is in it, the missable clock's names the event or the character) */
html:not(.sp2) .qRow[data-spoil="2"] [title],
html:not(.sp3) .qRow[data-spoil="3"] [title],
html:not(.sw2) .qRow[data-spoil="12"] [title],
html:not(.sw3) .qRow[data-spoil="13"] [title] { pointer-events: none; }
/* a row: one overlay over the whole row (its ::after, the row is its containing block), not one for each cell: a backdrop-filter is costly, on a phone most of all */
html:not(.sp2) tr[data-spoil="2"],
html:not(.sp3) tr[data-spoil="3"],
html:not(.sw2) tr[data-spoil="12"],
html:not(.sw3) tr[data-spoil="13"] {
	cursor: pointer;
	position: relative;
}
html:not(.sp2) tr[data-spoil="2"]::after,
html:not(.sp3) tr[data-spoil="3"]::after,
html:not(.sw2) tr[data-spoil="12"]::after,
html:not(.sw3) tr[data-spoil="13"]::after {
	content: "Tap to reveal (Part\00a0III)";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	/* (the label, centred over the whole row: the text of the overlay is not blurred by its own backdrop-filter) */
	display: flex;
	align-items: center;
	align-items: safe center; /* (a label taller than a small element, a link: it starts from the top, its first line whole, instead of being cut at both ends) */
	justify-content: center;
	justify-content: safe center;
	box-sizing: border-box;
	padding: 0 8px;
	text-align: center;
	white-space: normal;
	overflow: hidden;
	font-size: 92%;
	font-weight: normal;
	color: var(--fg);
	text-shadow: 0 0 1px #000, 0 0 2px #000, 0 0 2px #000, 0 0 3px #000, 0 0 2px #000;
}
html:not(.sp2) tr[data-spoil="2"]::after,
html:not(.sw2) tr[data-spoil="12"]::after {
	content: "Tap to reveal (Part\00a0II)";
}
@media (hover: hover) and (pointer: fine) {
	html:not(.sp2) tr[data-spoil="2"]::after,
	html:not(.sw2) tr[data-spoil="12"]::after {
		content: "Click to reveal (Part\00a0II)";
	}
	html:not(.sp3) tr[data-spoil="3"]::after,
	html:not(.sw3) tr[data-spoil="13"]::after {
		content: "Click to reveal (Part\00a0III)";
	}
}
/* a character's row (recruiting, growths, the support list): like the character icons */
html:not(.sp2) tr[data-spoil="2"][data-spoil-ch]::after,
html:not(.sp3) tr[data-spoil="3"][data-spoil-ch]::after,
html:not(.sw2) tr[data-spoil="12"][data-spoil-ch]::after,
html:not(.sw3) tr[data-spoil="13"][data-spoil-ch]::after {
	-webkit-backdrop-filter: blur(8px) grayscale(0.8);
	backdrop-filter: blur(8px) grayscale(0.8);
}
html:not(.sp2) [data-spoil="2"]:not(tr)::after,
html:not(.sp3) [data-spoil="3"]:not(tr)::after,
html:not(.sw2) [data-spoil="12"]:not(tr)::after,
html:not(.sw3) [data-spoil="13"]:not(tr)::after {
	content: "Tap to reveal (Part\00a0III)";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	border-radius: inherit;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	/* (the label, "Click to reveal" / "Tap to reveal" by the input the device has, centred over the blur: the overlay's own text is not blurred by its backdrop-filter) */
	display: flex;
	align-items: center;
	align-items: safe center;
	justify-content: center;
	justify-content: safe center;
	box-sizing: border-box;
	padding: 0 8px;
	text-align: center;
	white-space: normal;
	overflow: hidden;
	font-size: 90%;
	font-weight: normal;
	color: var(--fg);
	text-shadow: 0 0 3px #000, 0 0 6px #000;
}
html:not(.sp2) [data-spoil="2"]:not(tr)::after,
html:not(.sw2) [data-spoil="12"]:not(tr)::after {
	content: "Tap to reveal (Part\00a0II)";
}
@media (hover: hover) and (pointer: fine) {
	html:not(.sp2) [data-spoil="2"]:not(tr)::after,
	html:not(.sw2) [data-spoil="12"]:not(tr)::after {
		content: "Click to reveal (Part\00a0II)";
	}
	html:not(.sp3) [data-spoil="3"]:not(tr)::after,
	html:not(.sw3) [data-spoil="13"]:not(tr)::after {
		content: "Click to reveal (Part\00a0III)";
	}
}
/* (the DLC waves' labels) */
html:not(.sw2) tr[data-spoil="12"]::after { content: "Tap to reveal (DLC\00a0Wave\0000a02)"; }
@media (hover: hover) and (pointer: fine) { html:not(.sw2) tr[data-spoil="12"]::after { content: "Click to reveal (DLC\00a0Wave\0000a02)"; } }
html:not(.sw3) tr[data-spoil="13"]::after { content: "Tap to reveal (DLC\00a0Wave\0000a03)"; }
@media (hover: hover) and (pointer: fine) { html:not(.sw3) tr[data-spoil="13"]::after { content: "Click to reveal (DLC\00a0Wave\0000a03)"; } }
html:not(.sw2) [data-spoil="12"]:not(tr)::after { content: "Tap to reveal (DLC\00a0Wave\0000a02)"; }
@media (hover: hover) and (pointer: fine) { html:not(.sw2) [data-spoil="12"]:not(tr)::after { content: "Click to reveal (DLC\00a0Wave\0000a02)"; } }
html:not(.sw3) [data-spoil="13"]:not(tr)::after { content: "Tap to reveal (DLC\00a0Wave\0000a03)"; }
@media (hover: hover) and (pointer: fine) { html:not(.sw3) [data-spoil="13"]:not(tr)::after { content: "Click to reveal (DLC\00a0Wave\0000a03)"; } }
/* the blur alone, no label: the character icons of the lists, the recruitment lists' portraits, a name inside a text, and what is inside another blurred thing (one label for each) */
html:not(.sp2) .lr[data-spoil="2"]::after,
html:not(.sp3) .lr[data-spoil="3"]::after,
html:not(.sp2) #cmp .rc[data-spoil="2"]::after,
html:not(.sp3) #cmp .rc[data-spoil="3"]::after,
.rcSpoil[data-spoil]::after,
[data-spoil]:not(tr) [data-spoil]::after,
tr[data-spoil] > [data-spoil]::after,
html:not(.sw2) .lr[data-spoil="12"]::after,
html:not(.sw3) .lr[data-spoil="13"]::after,
html:not(.sw2) #cmp .rc[data-spoil="12"]::after,
html:not(.sw3) #cmp .rc[data-spoil="13"]::after {
	content: "" !important;
}
/* a blurred How to get row beside the popup's map picture (.idMapShot, floated): its box narrows beside the picture, so the blur doesn't cover it */
html:not(.sp2) :is(.acqLoc, .acqFull)[data-spoil="2"],
html:not(.sp3) :is(.acqLoc, .acqFull)[data-spoil="3"],
html:not(.sw2) :is(.acqLoc, .acqFull)[data-spoil="12"],
html:not(.sw3) :is(.acqLoc, .acqFull)[data-spoil="13"] {
	display: flow-root;
}
tr[data-spoil] > * [data-spoil]::after {
	display: none;
} /* the row's cells already cover it (inside a cell: a cell that is a spoiler itself, the support list's character cell, keeps its blur) */
/* character icons: stronger, the face gives it away */
html:not(.sp2) .lr[data-spoil="2"]::after,
html:not(.sp3) .lr[data-spoil="3"]::after,
html:not(.sp2) .tilech[data-spoil="2"]::after,
html:not(.sp3) .tilech[data-spoil="3"]::after,
html:not(.sp2) .gsChars [data-spoil="2"]::after,
html:not(.sp3) .gsChars [data-spoil="3"]::after,
html:not(.sp2) #cmp.modalWr .rc[data-spoil="2"]::after,
html:not(.sp3) #cmp.modalWr .rc[data-spoil="3"]::after,
html:not(.sw2) .lr[data-spoil="12"]::after,
html:not(.sw3) .lr[data-spoil="13"]::after,
html:not(.sw2) .tilech[data-spoil="12"]::after,
html:not(.sw3) .tilech[data-spoil="13"]::after,
html:not(.sw2) .gsChars [data-spoil="12"]::after,
html:not(.sw3) .gsChars [data-spoil="13"]::after,
html:not(.sw2) #cmp.modalWr .rc[data-spoil="12"]::after,
html:not(.sw3) #cmp.modalWr .rc[data-spoil="13"]::after {
	-webkit-backdrop-filter: blur(8px) grayscale(0.8);
	backdrop-filter: blur(10px) grayscale(0.8);
}
/* the character select screen: the tiles are big portraits, so stronger still */
html:not(.sp2) #md .tilech[data-spoil="2"]::after,
html:not(.sp3) #md .tilech[data-spoil="3"]::after,
html:not(.sw2) #md .tilech[data-spoil="12"]::after,
html:not(.sw3) #md .tilech[data-spoil="13"]::after {
	-webkit-backdrop-filter: blur(16px) grayscale(0.8);
	backdrop-filter: blur(16px) grayscale(0.8);
}
/* a character's name inside a text (Creek in Nathan's recruitment): blurred in place, without the label */
.rcSpoil[data-spoil] {
	display: inline-block;
}
/* Creek and Nathan in the recruitment lists: the blur covers the portrait and the name only */
html:not(.sp2) .rc.rcPart[data-spoil="2"]::after,
html:not(.sp3) .rc.rcPart[data-spoil="3"]::after,
html:not(.sw2) .rc.rcPart[data-spoil="12"]::after,
html:not(.sw3) .rc.rcPart[data-spoil="13"]::after {
	display: none;
}
.rc.rcPart[data-spoil] .rcName {
	display: inline-block;
}
html:not(.sp2) .rc.rcPart[data-spoil="2"] .rt,
html:not(.sp3) .rc.rcPart[data-spoil="3"] .rt,
html:not(.sp2) .rc.rcPart[data-spoil="2"] .rcName,
html:not(.sp3) .rc.rcPart[data-spoil="3"] .rcName,
html:not(.sw2) .rc.rcPart[data-spoil="12"] .rt,
html:not(.sw3) .rc.rcPart[data-spoil="13"] .rt,
html:not(.sw2) .rc.rcPart[data-spoil="12"] .rcName,
html:not(.sw3) .rc.rcPart[data-spoil="13"] .rcName {
	position: relative;
}
html:not(.sp2) .rc.rcPart[data-spoil="2"] .rt::after,
html:not(.sp3) .rc.rcPart[data-spoil="3"] .rt::after,
html:not(.sp2) .rc.rcPart[data-spoil="2"] .rcName::after,
html:not(.sp3) .rc.rcPart[data-spoil="3"] .rcName::after,
html:not(.sw2) .rc.rcPart[data-spoil="12"] .rt::after,
html:not(.sw3) .rc.rcPart[data-spoil="13"] .rt::after,
html:not(.sw2) .rc.rcPart[data-spoil="12"] .rcName::after,
html:not(.sw3) .rc.rcPart[data-spoil="13"] .rcName::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	border-radius: inherit;
	-webkit-backdrop-filter: blur(8px) grayscale(0.8);
	backdrop-filter: blur(8px) grayscale(0.8);
}
.spoilOpen [data-spoil]:not(.acqSpoil)::after { /* (acqSpoil: a Part III use of the item, hidden also in a popup the item itself opened) */
	display: none;
}
.spoilMap [data-spoil]::after { /* (the map's Part III tab: nothing is hidden, not even a Part III use of an item) */
	display: none;
}
.spoilOpen tr[data-spoil]::after {
	display: none;
}
/* (shown, not blurred: not the blurred element's click-to-reveal pointer, and the hidden rows' tooltips work again; app.js's click handler lets these clicks through too) */
.spoilOpen [data-spoil]:not(.acqSpoil), .spoilMap [data-spoil] { cursor: auto; }
.spoilOpen .qRow[data-spoil]:not(.acqSpoil) [title], .spoilMap .qRow[data-spoil] [title] { pointer-events: auto; }

/* the Part II / III question (app.js askSpoilers): the item popup's look (#idp rules above), tab buttons */
#spp {
	z-index: 1000;
	--frm: 1; /* (its frame (.mb::before) at full size on every screen; its close button keeps its size too: button#sppX, no narrow-screen rules) */
}
#spp[hidden] {
	display: none;
}
#spp .mb {
	width: min(480px, 100%);
	/* (at least the frame's top and bottom slices (.mb::before: 152 + 72 px x --frm): a box smaller than its border-image's widths has all of them scaled down to fit,
	   so the frame was drawn smaller than the other windows') */
	min-height: calc((152px + 72px) * var(--frm, 1));
	max-height: 100%;
}
#spp .sppC {
	overflow: auto;
	padding: 6px 20px 20px 20px;
	font-size: 15px;
	text-align: center;
}
#spp .sppC p {
	margin: 4px 0 12px;
	line-height: 1.45;
}
#spp .sppB {
	display: flex;
	flex-direction: column;
	gap: 6px;
	justify-content: flex-end;
}
/* the build Save / Load in the same dialog (app.js openBuildDialog: #spp.sppBuild): its own content instead of the question's, with the question's padding */
#spp.sppBuild .sppC,
#spp:not(.sppBuild) .sppBuildC {
	display: none;
}
#spp .sppBuildC {
	overflow: auto;
	padding: 10px 20px 20px 20px;
	font-size: 15px;
}
#spp .sppBuildC .bcSaveBox {
	margin: 0;
}

/* Save / Load under the Builder button (index.html #bdSave, the build page only): the Builder button's place and width, a row below it */
#bdSave {
	position: absolute;
	left: 24.8%;
	width: 8.8%;
	/* (#bdb's height: the larger of a fifth of its width (aspect-ratio 5 / 1; its width 8.8% of the layout = 8.8 --vw) and its text's (a line, its 4px padding
	   above and below, its 1px border); this box has #bdb's font size and line height, so 1lh is its line. Below it: its top, that height, 4px) */
	--bdH: max(calc(8.8 * var(--vw) / 5), calc(1lh + 10px));
	top: calc(33 * var(--vw) + var(--bdH) + 4px);
	display: flex;
	gap: 4px;
	z-index: 2;
	font-size: 16px;
	line-height: normal;
}
@media screen and (max-width: 1250px) {
	#bdSave {
		font-size: 14px; /* (as #bdb there) */
		/* (#bdb's 2px padding above and below there, not 4px: its height a line + 6px, and the row's place under it with it) */
		--bdH: max(calc(8.8 * var(--vw) / 5), calc(1lh + 6px));
	}
}
#bdSave[hidden] {
	display: none;
}
#bdSave > .pk.bdSaved {
	text-shadow: var(--glow); /* (app.js bcSavedFlash: "Saved", for a moment after saving) */
}
/* (as tall as #bdb; --gH, the height .gBtn's background pieces are sized for, the same) */
#bdSave > .pk {
	flex: 1;
	min-width: 0;
	--gH: var(--bdH);
	height: var(--bdH);
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 0;
	font-size: inherit;
	line-height: inherit; /* (#bdSave's, #bdb's: --bdH's 1lh is the same line here) */
}
@media screen and (max-width: 1000px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) {
	#bdSave {
		top: calc(32.6 * var(--vw) + var(--bdH) + 4px); /* (as #bdb.pk there: its top, its height at 12px) */
		font-size: 12px;
		line-height: 100%;
	}
}
@media screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) {
	.singleColumn:not(.builder) #bdSave {
		display: none;
	}
	/* (under the second spider chart, the combat stats' (.spider2: its top 38.87, its height 9.35 --vw), 6px below it) */
	#bdSave {
		top: calc((38.87 + 9.35) * var(--vw) + 6px);
		--bdH: max(calc(8.8 * var(--vw) / 5), calc(1lh + 10px)); /* (#bdb's 4px padding again here: a line + 10px) */
	}
	/* (the portrait view: the Builder button's 4px padding above and below again, not the 1250px rule's 2px) */
	#bdb {
		padding-top: 4px;
		padding-bottom: 4px;
	}
}
/* the selected-tab look (the caps and centre above): the caps scale with the button height, as --tabH does on a tab */
.sppC .pk {
	--tabH: 3em;
	--capW: calc(var(--tabH) * 20 / 36);
	cursor: pointer;
	width: 250px;
    min-width: fit-content;
	height: var(--tabH);
	margin: 0 auto;
	padding-left: var(--capW);
	padding-right: var(--capW);
	background-color: transparent;
	color: var(--text-control-active);
	text-shadow: inherit;
	text-align: center;
	border: 2px transparent solid;
}

#sppAll {
	transform: scale(0.9);
	width: 300px;
}

#sppThis {
	transform: scale(0.9);
	width: 220px;
}

.sppC .pk:hover,
.sppC .pk:focus-visible {
	text-shadow: var(--glow);
	outline: none;
}
/* item tiles (gifts, vegetables, fish, ores, meat, equipment lists): app.js renderItemTiles */
.itg[hidden] { display: none; }
.itg { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 6px; padding: 0; }
.modalWz .itg { 
	grid-template-columns: repeat(auto-fill, minmax(min(360px, calc(50% - 10px)), 1fr));
}


.modalWz .itile .itHead b:first-of-type { margin-left: 0;}

@media screen and (max-width: 600px) {
	.modalWz .itg { 
		grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
	}
}

.itile { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 3px; padding: 6px; text-align: left; color: inherit; text-decoration: none; border: 1px solid var(--line); position: relative; cursor: pointer; 
	overflow: hidden;
}
.itile[hidden] { display: none; }
.itile:hover, .itile:focus-visible { background: var(--sel); outline: none; }
.itile .itMain { display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }

.itile .itMain:hover {
  text-shadow: var(--bodyShadow);
}
.itile .itMain::after { content: ""; position: absolute; inset: 0; } /* the link covers the whole tile */
.itile .itMain:focus-visible { outline: none; }
.itile:has(.itMain:focus-visible) { background: var(--sel); outline: 2px solid var(--text); outline-offset: -2px; }
.itile .itHead { display: flex; align-items: center;
    flex-wrap: wrap;}
.itile .itHead .si {
	margin-right: 6px;
}

.itile .itHead b:first-of-type { margin-left: 2px;}
.itile .si { width: 24px; height: 24px; margin: 0; flex: none; object-fit: contain; }
.itile small { color: var(--mut); font-size: 12px; }
.itile .itDetail { color: var(--fg); margin-top: 2px; }
.itile .itLocs { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 1px; font-size: 12px; }
.itile .itLocs a { color: var(--text); }
.itile .itLocs .arrowLink { display: block; list-style: none; text-decoration: underline dotted; text-underline-offset: 2px; }
.itile .itLocs a.lmItem { text-decoration: underline dotted; text-underline-offset: 2px; }
.itile .itLocs a.lmItem .si { width: 1.2em; height: 1.2em; margin: 0 2px 0 0; object-fit: contain; vertical-align: text-bottom; }
.itLocs .acqLoc .srcK {
    margin-left: 3px;
}

/* items in the recruitment texts: app.js linkRecruitItems */
a.recItem { text-decoration: underline dotted; text-underline-offset: 2px; color: inherit; }
a.recItem .si { height: 1.2em; width: 1.2em; margin-right: 3px; vertical-align: text-bottom; }

.sr.bsort::before {
	content: "base ";
	font-size: 0.7em;
	opacity: 0.8;
}

#sortHint {
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%, calc(-100% + 6px));
	z-index: 10000;
	max-width: calc(100vw - 32px);
    border: 1px solid var(--line);
	padding: 6px 12px;
	background: var(--bgT);
	font-size: 14px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s, transform 0.2s;
}

#sortHint.show {
	opacity: 1;
	transform: translate(-50%, -100%);
}
/* a battle's group switch a clicked drop points to (its units are a later reinforcement, switched off): a gold glow for a moment (showBattleGroupHint) */
.bmFlash { animation: bmFlash 1.6s ease-out 2; }
@keyframes bmFlash { 0%, 100% { box-shadow: none; background-color: transparent; } 30% { box-shadow: inset 0 0 0 2px #f5c542; background-color: rgba(245, 197, 66, .22); } }
@media (prefers-reduced-motion: reduce) { .bmFlash { animation: none; outline: 2px solid #f5c542; } }

/* the level links above the class growths (Charioteer, Elephant Rider) */
.tierLinks {
	margin: 4px 0.25em 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
	padding-bottom: 8px;
}

.tierLinks:empty {
	padding-bottom: 0;
}

.tierLinks .mtBondBtn {
	padding: 6px;
}

.tierLinks :is(a, button) {
	cursor: pointer;
}
/* (the switches that are buttons (a unit's stats, a battle's difficulty and path): as the links, the page's text shadow, none of the browser's own look) */
.tierLinks button {
	text-shadow: inherit;
	-webkit-appearance: none;
	appearance: none;
}

.tierLinks>:is(a, button) {
    display: flex;
    align-items: center;
	text-decoration: none;
}

.tierLinks :is(a, button).on,
.scPlanBtn.on {
    text-shadow: var(--glow);
    background: var(--surface-tab-open) !important;
    border: 1px solid var(--line);
}

.idPic {
	display: block;
    max-width: min(calc(100% - 10px), 300px);
	height: auto; /* (with the width and height attributes: the height follows the width, the proportions stay) */
	margin: 8px auto 0;
    background-color: var(--surface-picture);
    -webkit-mask-image: url(../images/ui/IdPicMask.png);
    mask-image: url(../images/ui/IdPicMask.png);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.idPicFloat {
	max-width: fit-content;
}

.supportPairedNote {
	white-space: nowrap;
    margin-left: 6px;
}

.hrt {
    margin-left: 2px;
	vertical-align: -0.3em;
    height: 1.3em;
    width: auto;
    color: var(--acc);
}
/* the requirements (items, coin flip, paralogue): after the paths, below a divider line */
.rcCont small.rcItems {
	display: block;
	margin-top: 4px;
	padding-top: 4px;
	border-top: 1px solid var(--line);
}

.rcCont small:has(+ .rcItems) {
	display: block;
}

/* the Boons tab: the skill icons centered */
.boonCol {
	text-align: center;
}

/** Tab sizes*/
@media screen and (max-width: 600px) {
	/* the tabs as a grid of thirds */
	#cmn .mTabList {
		display: flex;
		flex-wrap: wrap;
		max-width: none !important;
    	justify-content: flex-start;
        margin: 0 calc(0.2em - 36px) 0 0.2em; /* (under the title: the room for the close button is not needed) */
	}

	#cmn .mTabList>a {
		display: flex;
		margin: 0;
		flex-basis: 33.3333%;
    	justify-content: flex-start;
	}
	/* more tabs than fit in one row of thirds: the list is a block of its own under the title (its width in thirds is not known when the row is
	   filled, so it would be squeezed next to the title and wrap there) */
	#cmn .mTabList:has(> a:nth-child(4)) {
		flex-basis: 100%;
	}
	/* the sort bar and search always have a line of their own, centered on the whole header (the right margin takes back the room kept for the close button) */
	#cmn .mTools {
		flex-basis: 100%;
		margin-right: -36px;
	}

	#cmp.modalfastest thead {
    	display: none;
	}
	

	#cmp.modalfastest th {
    	display: none;
	}

	#cmp.modalfastest td {
    	grid-column: span 4;
	}

	.fastPath {
		display: block;
	}
}

@media screen and (max-width: 450px) {
	#mtb .pk {
		margin: 0 calc(-0.3 * var(--capW)) !important;
	}
}

@media screen and (max-width: 400px) {
	#cmn .mTabList>a {
		flex-basis: 50%;
	}

	.modalWz .mTabList>a {
		flex-basis: 33.3333% !important;
	}
}

@media screen and (max-width: 300px) {
	#cmn .mTabList>a {
		flex-basis: 100%;
	}
}



table.gambitArea {
    width: auto;
}

html body table.gambitArea tr > td {
    padding: 0 !important;
    width: 10px !important;
    height: 10px !important;
    border: 0 !important;
	color: var(--mut) !important;
    line-height: 0 !important;
	padding: 1px !important;
    border: 1px solid var(--line) !important;
	box-sizing: content-box !important;
}

table.gambitArea tr {
    display: table-row !important;
}

/* a learnset entry's requirement (Lv. 45) after its name, inside its link */
.skNote {
	color: var(--mut);
	font-size: 0.8em;
	margin-left: 3px;
	white-space: nowrap;
}

/* the item popup's map picture (the map cropped to where the item is, a red dot on each place), beside its How to get list */
.idMapShot {
	float: right;
	margin-left: 6px;
	margin-bottom: 6px;
	margin-top: 10px;
}
.idMapShot img {
	display: block;
	width: 120px;
	height: 120px;
	background: var(--surface-map-shot);
    -webkit-mask-image: url(../images/map/ui/Thumb_Recipe_Mask.webp);
    mask-image: url(../images/map/ui/Thumb_Recipe_Mask.webp);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* a gambit's attack pattern picture in the popups (worker/gambit-images.js): sized by its width/height, 19 px a cell */
.idArea .gambitImg {
	display: block;
	max-width: 100%;
	height: auto;
}

/* the Items list's All tab: a tile for each category with its number of items, the searches inside it under the tile (app.js renderItemOverview) */
.catGrid { 
	display: grid; 
	grid-template-columns: repeat(auto-fill, minmax(max(calc(25% - 10px), min(360px, 100%)), 1fr)); 
	gap: 6px; padding: 6px 6px 0; }
.catGrid[hidden] { display: none; }
.catGroup { 
	display: flex; flex-direction: column; gap: 4px; 
    padding: 4px;
	 position: relative; }
.catTile {
	display: flex;
	align-items: center;
	gap: 8px;
	box-sizing: border-box;
	color: var(--text);
	text-decoration: none;
	/* the style of the map's tabs (#lmn .pk): a box, lighter when hovered or focused (the link covers the whole tile, so hovering the tile) */
	border: 2px solid var(--boxLine);
	background-color: var(--surface-control);
	border-radius: 0;
	padding: 4px;
}
.catTile:hover, .catTile:focus-visible { background-color: var(--surface-control-active); border-color: var(--border-control-active); outline: none; }
.catTile .si { width: 24px; height: 24px; margin: 0; flex: none; object-fit: contain; }
.catTile small { color: var(--mut); font-size: 12px; margin-left: auto; }
.catSubs {
	display: flex; 
	flex-wrap: wrap; 
	margin-top: 2px;
	position: relative; z-index: 1;
    pointer-events: none;
    margin-left: -2px;
    margin-right: -2px; }
/* a type tile: the link is the wrapper (2px of padding, which is the space between tiles), the box inside it is what is drawn */
a.catSub {
    min-width: 50%;
    box-sizing: border-box;
    padding: 2px;
    color: var(--text);
    text-decoration: none;
    pointer-events: all;
}
a.catSub:focus-visible { outline: none; }
/* the box inside the link: a thin bordered box, lighter when hovered or selected (the count at its right end) */
.catSubIn {
	display: flex;
	align-items: center;
    align-content: center;
	height: 100%;
	box-sizing: border-box;
	border: 1px solid var(--line);
	padding: 1px 6px;
	line-height: 20px;
	font-size: 14px;
	white-space: nowrap;
}
.catSub:hover .catSubIn, .catSub:focus-visible .catSubIn, .catSub.on .catSubIn { background: var(--sel); }
.catSub small { color: var(--mut); margin-left: auto; padding-left: 8px; } /* (the box is a flex row now: the space before the count is a margin) */


.catSub .si {
    width: 18px;
    height: 18px;
    margin: 0 3px 0 0;
    object-fit: contain;
    vertical-align: top !important;
    line-height: 100%;
    margin-left: -4px;
	margin-right: 6px;
}
/* breadcrumb tab line (Items: All items -> Ores) */
.crumbSep { flex: none; margin: 0 6px; align-self: center; }
.modalTitle .crumbLink { pointer-events: auto; } /* (the Items link in the title is a tab: the selected tab's style, #cmn a.pk.cn.on[data-view]) */

.catOpts {
    padding: 6px;
    pointer-events: auto;
    justify-content: center;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(50%, 200px), 1fr));
    box-sizing: border-box;
    max-width: 100%;
}

.catOpts .catSubIn {
    border: 2px solid var(--boxLine);
    background-color: var(--surface-control);
    font-size: 14px;
    line-height: 24px;
    overflow: hidden;
}

.catOpts .catSubIn .si {
    margin-left: -1px;
    margin-right: 4px;
}

#lmd>.divider {
    height: 6px;
}

.lmSec .divider {
    height: 3px;
    margin-bottom: 4px;
}
/* item list view (Tiles / List toggle, app.js renderItemTiles): the same tiles laid out as table rows on shared columns */
.itView { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; }
.itHdr { display: none; } /* the list view's header: a table header like the modals' (#cmc thead / th) */
.itBtns { display: inline-flex; border: 1px solid var(--line); }
.itBtns button { all: unset; box-sizing: border-box; cursor: pointer; padding: 3px 12px; font-size: 13px; color: var(--mut); }
.itBtns button + button { border-left: 1px solid var(--line); }
.itBtns button:hover, .itBtns button:focus-visible { background: var(--sel); color: var(--text); }
.itBtns button[aria-pressed="true"] { background: var(--sel); color: var(--text); }
.itCell { display: none; }
@media screen and (min-width: 701px) {
	.itg.itl { grid-template-columns: minmax(170px, 1.2fr) repeat(var(--ic), minmax(56px, .5fr)) minmax(200px, 2fr) minmax(150px, 1fr); gap: 0; }
	.itl .itHdr { display: contents; }
	.itl .itHdr thead, .itl .itHdr tr { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; }
	.itl .itHdr th { display: block; }
	.itl .itile { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: start; gap: 0; border-width: 0 0 1px; padding: 0; }
	.itl .itile .itMain { display: grid; grid-template-columns: subgrid; grid-column: 1 / calc(var(--ic) + 3); align-items: start; gap: 0; }
	.itl .itile .itMain > * { padding: 6px 10px; }
	.itl .itile .itMain .itHead { grid-column: 1; }
	.itl .itile .itMain .itSub { display: none; }
	.itl .itile .itMain .itCell { display: block; grid-column: calc(var(--n) + 2); }
	.itl .itile .itMain .itDetail { grid-column: calc(var(--ic) + 2); margin-top: 0; }
	.itl .itile .itMain .idArea { grid-column: calc(var(--ic) + 2); }
	.itl .itile .itLocs { grid-column: calc(var(--ic) + 3); margin-top: 0; padding: 6px 10px; }
}
@media screen and (max-width: 700px) {
	.itl.itg { grid-template-columns: 1fr; }
}

/* a skill list row's details (app.js skillRowDetail), shown by the button at the end of the list */
.sk li .skDet { flex: 1 0 100%; padding: 2px 8px; padding-top: 0; padding-right: 0;}

@media screen and (max-width: 800px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) { /* (and the portrait layout at every width: it is laid out at 800 px, index.html scaleToFit) */
	.sk li .skDet {
		padding-left: 0;
	}
}

.sk li .skDet[hidden] { display: none; }
.sk li .skDet .idText { 
	margin: 0; 
	font-size: 0.92em; 
    padding-bottom: 2px;
}

.card .skDet .idText {
    font-size: 0.92em;
}

.skExpand { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; padding: 2px; font-size: min(13px,0.9286em); cursor: pointer; background: transparent; 
	padding-right: 6px;
    color: var(--textDark); border: 1px solid var(--line); }
.skExpand:hover, .skExpand:focus-visible { background: var(--sel); }
.skExpand svg { height: 1.2em; aspect-ratio: 16 / 12; fill: currentColor; flex: none; }
.skExpand .less, .skExpand[aria-expanded="true"] .more { display: none; }
.skExpand[aria-expanded="true"] .less { display: inline; }

.skDet .idStats span {
    flex-direction: row;
	min-width: auto;
    border: 0;
    background: transparent;
}

.skDet .idStats span:first-child {
    padding-left: 0;
}

.skDet .idStats span:last-child {
    padding-right: 0;
}

.skDet .idStats span>small {
    margin-right: 5px;
	line-height: normal;
}

/* the one button for all the lists: stays in view at the right of the first list's header while scrolling */
.skExpandBar { position: relative; top: 12px; right: -8px; z-index: 3; height: 0; display: flex; justify-content: flex-end; padding-right: 10px; pointer-events: none; }
.skExpandBar .skExpand { pointer-events: auto; height: 1.7em; } /* (22 px at its 13 px text; in em so it stays in step with the text where that is smaller (the wide portrait layout)) */
/* a support that has a paired ending (A+): app.js renderSupportsTable */
.pairMark { color: var(--text-pair-mark); white-space: nowrap; }
.likeNote {
	color: var(--text-dislike-note);
	margin-left: 4px;
}
.giftContainer svg {
	height: 1em;
    vertical-align: top;
}
.giftContainer path {
	fill: currentColor;
}
.pairMark small { color: inherit; }

@media screen and (max-width: 600px) { .pairMark small { display: none; } }
/* (the tab / tier buttons' look, .gBtn: its own border, padding and hover; only its place here) */
.pairToggle {
	 margin: 2px 8px 2px 0;
	 cursor: pointer;
	 color: var(--text);
}

.pairToggle::before {
	display: none;
}
.giftList .pk:hover,
.giftList .pk:focus-visible,
.foodItem:hover {
	background: var(--sel);
}
/* the Stat calculator tab (app.js renderStatCalculator, hidden by STAT_CALC_TAB) */
#scb[hidden] { display: none; }
.statCalc select,
.buildPage select {
    width: auto;
	color: inherit;
	margin-right: 1px;
    height: 31px;
    padding: 2px;
	text-align: right;
}

select::-webkit-scrollbar {
  width: 4px;
}

select::-webkit-scrollbar-track {
  background-color: transparent;
  border: 0;
}

select::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border: 0;
}

.statCalc .scTop { margin: 4px 0 10px; }
.scTable th, .scTable td { text-align: center; padding: 3px 4px; }
.scTable tbody th { text-align: left; white-space: nowrap; }
.scIn {
	margin-right: 1px;
    height: 31px;
    width: 31px;
	padding: 0;
	 text-align: center; background: transparent; color: inherit; border: 1px solid var(--line); font: inherit; }
.scLv { font: inherit; 
}
.scConclusion { margin: 10px 0 4px; }
.scNext:empty { display: none; }
.scNext { margin: 4px 0; }
.scNote { margin: 4px 0 10px; padding: 6px 8px; border: 1px solid var(--line); }
.scNote:not(.reclassNote) {
    margin-top: 30px;
}
.scNote b { color: var(--text); }
/* the Stat calculator's up / down buttons and class lists (app.js statCalcStepper, .scDd) */
.scNum { display: inline-flex; align-items: center; vertical-align: middle;
    margin: 1px 2px; }
.scStepBtns { display: inline-flex; flex-direction: column; }
.scStep { font-size: 8px; line-height: 1; padding: 0; color: inherit; background: transparent; border: 1px solid var(--line); cursor: pointer;
    width: 19px;
    height: 15px; }
.scStep:last-child {
	margin-top: 1px;
}
.scStep:hover, .scStep:focus-visible { background: var(--sel); outline: none; }
.scIn { -moz-appearance: textfield; appearance: textfield; }
/* the entered stats' reset button, after the total (app.js renderStatCalculator) */
.scReset[hidden] { display: none; }
.scReset { width: 16px; height: 24px; padding: 0; margin-left: 4px; line-height: 1; flex: none; }
.scIn::-webkit-inner-spin-button, .scIn::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.scDd { position: relative; display: inline-block; 
    vertical-align: text-bottom; }
.scDdBtn {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    vertical-align: text-bottom;
    border: 1px solid var(--line);
    padding-right: 4px;
    margin-right: 2px;
    padding-left: 0;
}

.scDd .ci.mi {
    margin-right: 3px;
    height: 1.3em;
    margin-left: 2px;
}

.scGrid:not(.scInputs) .scLine {
    border-bottom: 1px solid var(--line);
    /* (one height in every cell, the label one too, so the borders line up: with height: 100% they shrank unevenly, the Difference box being taller than the text) */
    height: 1.4em;
    flex: none;
}

.scLine .ci {
    pointer-events: none;
    margin-right: -8px !important;
    margin-top: -1px !important;
}

span.classPicker {
    display: flex;
    margin: 2px 0;
    gap: 4px 8px;
    justify-content: space-between;
    align-items: center;
}

span.scPath {
    display: block;
    width: fit-content;
}

.scDd .ci { height: 1.4em; width: auto; vertical-align: middle; margin-right: 0; }
.scDdBtn>.ci { margin-left: 0;}
.scDdList { box-sizing: border-box; position: absolute; z-index: 30; left: 0; top: 100%; display: block; min-width: 100%; max-height: 280px; overflow: auto; margin: 2px 0 0; padding: 2px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }
.scDdList[hidden] { display: none; }
.scDdList .scOpt { display: flex; align-items: center; gap: 6px; padding: 3px 8px; white-space: nowrap; cursor: pointer; }
.scDdList .scOpt:hover, .scDdList .scOpt.on { background: var(--sel); }
.scDdList .scOpt:focus { background: var(--sel); outline: 1px solid var(--text); outline-offset: -1px; }
/* the reclass suggestions: a box for each tier (or the recruitment level), in a row that wraps (app.js statCalcSugGroups) */
.scSugGroups { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 4px; }

@media screen and (max-width: 1000px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) { /* (and the portrait layout at every width: it is laid out at 800 px, index.html scaleToFit) */
	.scSugGroups { gap: 8px 9px; }
}
.scSugHead { margin-bottom: 2px; 
    border-bottom: 1px solid var(--line);
    padding-bottom: 3px;
}
	.reclassHeader {
    margin-bottom: 6px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1px;
    width: fit-content;
    margin-top: 8px;
	}
.scSug { display: block;}
.scSug .ci { height: 1.4em; width: auto; vertical-align: middle; margin-right: 2px; }
/* the description under an ability in the Characters list's Abilities tab (app.js abilityCell) */
.abilityDesc { display: block; color: var(--mut); line-height: 1.25; }
#cmc .abilityColumn > div { margin-bottom: 4px; }
#cmc .abilityColumn > div:last-child {
    margin-bottom: 0;
}

.abilityColumn .abilityDescription {
    border-bottom: 0;
}

.statCalc *:not(.scOpt):not(button)>.ci,
.scDd *:not(.scOpt):not(button)>.ci {
    margin: 0;
	margin-right: 3px;
	margin-left: -1px;
}
/* the Stat calculator's grid: a cell per stat (expected, typed, difference), as many to a row as fit */
.scGrid { 
    flex-wrap: wrap;
    display: flex; gap: 2px 0; margin: 8px 0; }
.scCell { display: flex; flex-direction: column; gap: 3px; }
/* the header cells (HP, Str, ...): as the support table's, a framed box */
.scHead { position: relative; isolation: isolate; display: block; padding: 4px 8px; font-weight: normal; text-align: center; white-space: nowrap; user-select: none;}
.scHead::before { content: ""; position: absolute; inset: 2px; border: 2px var(--border-control) solid; background-color: var(--surface-control); box-sizing: border-box; z-index: -1; }
.scLine { display: flex; justify-content: center; align-items: center; gap: 6px; height: 100%; }
.scLabels .scLine { justify-content: flex-start; }
.scLabels .scHead { visibility: hidden; } /* (the empty header of the label box: it only keeps the lines level with the others) */
.scLine small { color: var(--mut); }
.scExp, .scTyped, .scTypedW, .scFut { min-width: 2em; text-align: center; }
.scResults [data-sctip] { cursor: pointer; } /* (a click shows what the number is made of: statCalcResultTip, app.js) */
.scDiff, .scYours { min-width: 2.6em; text-align: center; } /* (Yours: shaded as its difference, app.js statCalcShade) */
.lmFound li { flex-wrap: wrap; }
.lmFound li .acqTrade { flex-basis: 100%; }
.lmWrongPath {
    flex-basis: calc(100% + 16px);
    color: var(--text);
    background-color: var(--surface-wrong-path);
    padding: 2px 5px;
    margin: 0 -8px;
}
.lmWrongPathT {font-weight: bold;}.idText.idUpgrade { margin-top: 0; }
/* the Battalions modal: the gambit's attack pattern floats right in its column */
.gmFloat { float: right; margin: 0 0 2px 6px; }
/* the builder tab: the sheet shows the typed stats (app.js builderStatsSync), without the growth bars */
body.builder #gt td { background: none !important; }
.tilebt .si { height: 1.2em; margin-right: 4px; }
/* the arrow that says the class button opens a list */
.scDdBtn::after { content: "\25be"; }
/* How to get (beside the map picture): its text runs on under the picture when the section is taller, instead of staying in a column next to it */
.idSec[data-sec="acquire"] { display: block; }
/* the Arts list's Show upgraded: the values the upgrade changes (as in the popup's upgrade table) */
#cmc td.artUp {
	color: var(--text-upgrade);
}

/* the liked gifts tab (gift_d.js): the Part I / Part III buttons, the dislikes line, the favourite meals, temples and plays */
/* the Part I / Part III links: the level links' style (.tierLinks) */
.giftContainer .tierLinks {
	margin: 0 0 10px;
}

.giftBtn {
	padding: 4px 6px;
	padding-left: 4px;
	text-decoration: none;
}

/* a gift button with its points inside, on the right */
.giftBtn.hasPts {
    display: flex;
    flex-direction: column;
}

.giftBtn .giftName {
	flex: 1;
	min-width: 0;
}

.giftExtraC {
    margin-left: auto;
}

/* gold per point (app.js giftGpHtml): green up to 2, redder towards 20 (--r) */
.giftBtn .giftGp {
	margin-left: auto;
	padding-left: 10px;
	white-space: nowrap;
	color: color-mix(in oklch, var(--text-gift-negative) var(--r, 0%), var(--text-gift-positive));
	max-height: none !important;
}
.giftBtn .giftGp + .giftPts {
	margin-left: 0;
}
.giftBtn .giftPts {
	margin-left: auto;
    min-width: 3em;
    display: inline-block;
	text-align: right;
	padding-left: 3px;
	color: color-mix(in srgb, var(--text-gift-positive) var(--g, 0%), var(--mut)); /* the muted colour at 50 points, full green at 200 (--g, set by app.js itemButton) */
	max-height: none !important;
}
.giftDislikes,
.giftExtra {
	margin: 10px 0 0;
	color: var(--mut);
}
.giftDislikes b,
.giftExtra b {
	color: inherit;
	font-weight: bold;
	margin-right: 4px;
	color: var(--text);
}

.giftExtras {
	margin-top: 6px;
}

.giftDislikes .lmItem {
    vertical-align: baseline;
}

/* the meals' header pictures (Great / Good / Bad) and the food pictures under them (the liked gifts page) */
.foodHdr {
    display: block;
    height: 40px;
    width: auto;
    margin: 0;
    margin-bottom: -15px;
    z-index: 1;
    position: relative;
}
.idSec .foodHdr {
	margin-bottom: -9px;
}

/* (as many columns as fit, none narrower than 8.5em; the tiles fill their column) */
.foodList {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(8.5em, 1fr));
	gap: 8px;
	margin-top: 8px;
}
.foodItem {
	display: flex;
	flex-direction: column;
	align-items: center;
	box-sizing: border-box;
	text-align: center;
	text-decoration: none;
    border: 1px solid var(--line);
    background: var(--bgT);
	padding: 4px;
}


.foodItem .foodHdr {
	margin: 0;
	border: 0;
	border-radius: 0;
	object-fit: contain;
    height: auto;
    margin-bottom: -1em;
    height: 2.667em;
    width: auto;
}

.foodItem img {
	width: 4.8em;
	height: 4.8em;
	object-fit: cover;
}

.foodItem span {
    margin-top: --1em;
}

.giftHdr {
	display: block;
	height: 1.8em;
	width: auto;
    border: 1px solid var(--line);
}
.idSec .giftHdr {
	margin-bottom: -1px;
    height: 2em;
}
/* the points a gift adds to a character's support, inside the character icon (the gift popup) */
a.lr .lrPts {
    position: absolute;
    right: -6px;
    top: -2px;
    padding: 0 3px;
    color: color-mix(in srgb, var(--text-gift-positive) var(--g, 0%), var(--mut)); /* muted at 50 points, full green at 200, as on the gift buttons */
    font-size: 10px;
    line-height: 1.35;
    text-decoration: none;
    pointer-events: none;
    filter: drop-shadow(0px 0px 1px black) drop-shadow(1px 1px 1px black);
}

/* the build creator at the top of the builder: the Create a build button, then the inventory, abilities and arts */
.bcCreateP {
	margin: 0 0 12px;
}

/* the build page's Save / Load (app.js bcSaveHtml): the two buttons, then the open one's box: a name and Save, or the saved builds (a link each, its delete button) */
.bcSaveBar {
	display: flex;
	gap: 6px;
	margin: 6px 0;
}
.bcSaveBox {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0 0 8px;
}
/* (the look of the search fields (input[type="search"]: its border, colours and focus), without the looking glass; the height of the build page's item search) */
.bcSaveName {
	flex: 1 1 12em;
	min-width: 0;
	height: 28px;
	box-sizing: border-box;
	color: var(--text);
	max-width: 400px;
	background-image: none; /* (input's background, var(--bg), has a texture over the colour: the search fields replace it with their looking glass) */
}
.bcSaveMsg {
	flex-basis: 100%;
	color: var(--textDark);
}
.bcSaveBox.bcSavedList {
	flex-direction: column;
	align-items: stretch;
	flex-wrap: nowrap;
}
.bcSavedRow {
	display: flex;
	gap: 4px;
}
/* (a saved build and its delete button: the controls' look (the search fields', the list modals' buttons): a 2px border, the control colours, brighter hovered) */
#spp a.bcSavedLink,
#spp .pk.bcSavedDel,
#spp .pk.bcSaveOk {
	border: 2px solid var(--border-control);
	background: var(--surface-control);
	color: var(--text);
	text-decoration: none;
	border-radius: 0;
}
#spp a.bcSavedLink {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding: 4px 8px;
}
.bcSavedLink span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.bcSavedLink small {
	color: var(--textDark);
}
/* (the Save button beside the name: as tall as the name box, the row's height) */
#spp .pk.bcSaveOk {
	flex: none;
	align-self: stretch;
	box-sizing: border-box;
	padding: 0 14px;
	font-weight: bold;
}
#spp .pk.bcSavedDel {
	flex: none;
	width: 2.4em;
	padding: 0;
	text-align: center;
}
#spp a.bcSavedLink:is(:hover, :focus-visible),
#spp .pk.bcSavedDel:is(:hover, :focus-visible),
#spp .pk.bcSaveOk:is(:hover, :focus-visible) {
	background-color: var(--surface-control-active);
	border-color: var(--border-control-active);
	outline: none;
}

/* "Create a build": as the paired endings button (.pairToggle.bt): its background, border and hover */
.pk.bcCreate,
.pk.scPlanBtn {
	background: var(--bgT);
	border: 1px solid var(--line);
	padding: 8px 12px;
	color: var(--text);
	display: inline-block;
	text-decoration: none;
	font-weight: bold;
}

.pk.scPlanBtn {
    font-weight: normal;
}

/* (not a .gBtn one (Create a build is): its own hover pictures, .pk.gBtn.gBtn:not(.on):hover, which this flat background replaced) */
.pk.bcCreate:not(.gBtn):hover,
.pk.scPlanBtn:not(.gBtn):hover,
.pk.bcCreate:not(.gBtn):focus-visible,
.pk.scPlanBtn:not(.gBtn):focus-visible {
	background: var(--sel);
}

.buildPage .bcRow .si:not([alt="Scroll"]) {
	width: 1.4em;
	height: 1.4em;
}


.buildPage .bcRow .si[alt="Scroll"] {
	margin-left: 3px;
	width: 1em;
	height: 1em;
}

.bcRow,
.bcOpt {
    display: flex;
    gap: 4px;
    width: 100%;
    margin: 0 0 4px;
    padding: 4px;
    text-align: left;
    color: var(--text);
    font: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
    box-sizing: border-box;
    border-bottom: 1px solid var(--line);
    align-items: center;
    padding-top: 0;
}

.bcRow:hover,
.bcOpt:hover,
.bcOpt.on { /* (.on: the entry the keys highlight in a list search, app.js) */
	border-color: var(--border-quest-selected); /* (a soft gold, as the text: was var(--text), too strong, the user 2026-11-25) */
}

.bcEmpty {
	color: var(--mut);
	font-style: italic;
}

.bcRow small,
.bcOpt small {
	color: var(--mut);
}

.bcTag {
	padding: 0 6px;
	border: 1px solid var(--line);
	border-radius: 99em;
}

/* an equipped item or spell on the build page (app.js bcEqIcon): images/equipped.png over the top left corner of its icon */
.bcEqIc {
	position: relative;
	display: inline-flex;
	flex-shrink: 0;
}

.bcEqMark {
    position: absolute;
    left: -0.33333em;
    top: -0.33333em;
    width: 1em;
    height: 1em;
    margin: 0;
    pointer-events: none;
}

.buildPage .namedAbility small {
    display: none;
}

.buildPage .lmItem {
    padding-bottom: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
    display: block;
}

.scSum .scLine {
    gap: 0;
}

.bcFade {
    color: var(--text-faded);
}

.bcFade>* {
    filter: brightness(0.5) contrast(1.2) grayscale(0.6);
}

.bcPick {
    margin: 0 0 8px;
    padding: 4px;
    background: var(--surface-picker);
    border: 2px solid var(--boxLine);
    margin-top: -5px;
}

.bcSearch {
	width: 100%;
	margin: 0 0 6px;
}

/* the list's top: the search box and the close button (app.js renderBuildCreator opts; the look of the other close buttons) */
.bcPickHead {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 6px;
}
.bcPickHead .bcSearch {
	flex: 1;
	min-width: 0;
	margin: 0;
	height: 28px; /* (the close button's) */
	box-sizing: border-box;
}
.bcClose {
	position: relative;
	flex: none;
	width: 28px;
	height: 28px;
	padding: 0;
	margin-left: auto;
}
.bcClose::before {
	inset: 0;
}

.bcOpts {
	max-height: 260px;
	overflow-y: auto;
}

.bcOpt[hidden] {
	display: none;
}

.bcMenu {
	display: flex;
	gap: 6px;
	margin: 0 0 6px;
}

.bcFixed {
	cursor: default;
}

.bcFixed:hover {
	border-color: var(--line);
}

.bcUses {
	margin-left: auto;
	font-variant-numeric: tabular-nums;
    width: 4em;
    text-align: right;
}
/* a row's icon, name and requirement together (app.js renderBuildCreator: the inventory and the spells), the effectiveness and uses after it */
.bcLabel {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-width: 70%;
}

.bcRow>.bcLabel {
    min-width: min-content;
	flex-basis: 70%;
    max-width: 100%;
}
/* a weapon's or spell's effectiveness icons (app.js renderBuildCreator eff / spellEff): on the right, just before its uses */
.bcEff {
	display: inline-flex;
	align-items: center;
	gap: 2px;
    margin-right: auto;
}
.bcEff + .bcUses {
	margin-left: 8px;
}

/* the build page: the items and spells on the left, the abilities and arts on the right (one column on a narrow screen) */
.bcCols {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 20px;
	align-items: start;
}

/* one column (a narrow page, the small portrait view): the two groups' boxes in one list, the spells and the bloodmark (.bcLate) after the abilities */
@media (max-width: 700px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) { /* (and the portrait layout at every width: it is laid out at 800 px, index.html scaleToFit) */
	.bcCols {
		grid-template-columns: minmax(0, 1fr);
	}
	.bcCols .abGrp {
		display: contents;
	}
	.bcCols .ab.bcLate {
		order: 1;
	}

	.bcCols .ab {
		margin-bottom: 4px;
	}
}

.levelContainer {
	display: flex;
	gap: 2px;
	flex-direction: column;
	margin-right: 8px;
    justify-content: space-between;
}

.levelContainer>span {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.bcLevel {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
    flex-wrap: wrap;
}

/* the rows that cannot be changed open their popup */
.bcFixed[data-item] {
	cursor: pointer;
}

.bcFixed[data-item]:hover {
	border-color: var(--border-quest-selected);
}

/* the buttons at the top of the popup opened from the build page */
.bcPopupBar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 10px;
}

/* the rows of the modals' tables that open an item (app.js rowItemLink): the row is a link as a whole, a light gold overlay on hover */
#cmc tbody tr:is(:has(> :first-child a[data-item]), :has(> :first-child [data-ch]), :has(> [data-ch]:first-child)):not(.itile *) { cursor: pointer; }
@media (hover: hover) {
	#cmc tbody tr:is(:has(> :first-child a[data-item]), :has(> :first-child [data-ch]), :has(> [data-ch]:first-child)):hover > td {
		box-shadow: inset 0 0 0 100vmax var(--glow-item-row);
	}
}
#cmc table[hidden] { display: none !important; }
/* equipment: the stats line is for the small views (the table has a column for each stat) */
td.equipDetail, th.equipDetail { display: none; }
/* the numbers of the stats line: regular text (the small line around them is smaller and muted) */
.equipNum { font-size: calc(1em / 0.9); color: var(--fg); }
/* a stat of the stats line: a box of its own, coloured like the column's cells (the style comes from the cell) */
.equipChip { display: inline-block; margin: 0 4px 2px 0; padding: 0 6px; }

/* a drop-down menu of the nav (the Database menu: app.js databaseMenu) */
.navMenu {
	position: fixed;
	z-index: 10;
	display: flex;
	flex-direction: column;
	min-width: 9em;
	padding: 3px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
    background: var(--bg);
    border: 1px solid var(--line);
}
.navMenu[hidden] { display: none; }
.navMenu a {
	padding: 6px;
	color: var(--text);
	font-size: 15px;
	text-decoration: none;
	white-space: nowrap;
}
.navMenu a:hover,
.navMenu a:focus-visible {
	background: var(--surface-control-activeTransparent) !important;
	outline: none;
}

/* the Database button: a drop-down arrow (an svg in the button, in its text colour) after its name; it points up while the menu is open. Its glow is
   the button's: the text-shadow of the text, as drop-shadows (the same on the small screens' buttons, which only glow on hover) */
#gfb .moreArrow { display: inline-block; width: 0.6em; height: 0.36em; margin-left: 4px; vertical-align: middle; filter: drop-shadow(0 0 2px var(--glow-warm)) drop-shadow(0 0 5px var(--glow-warm)); }
@media screen and (max-width: 1000px) and (min-aspect-ratio: 205 / 100), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) {
	#gfb .moreArrow { filter: none; }
	#gfb:hover .moreArrow, #gfb:focus .moreArrow { filter: drop-shadow(0 0 2px var(--glow-warm)) drop-shadow(0 0 5px var(--glow-warm)); }
}

/* the icons of the compare buttons and of the Database menu (.cbIcon) */
.cbIcon {
	height: 1.25em;
	width: 1.25em;
	object-fit: contain;
	margin-right: 0.3em;
    vertical-align: text-top;
}
.cbDots {
	height: 0.4em;
	width: 1.1em;
}
.navMenu a .cbIcon {
	margin-right: 0.6em;
}

/* the characters' Ability finder tab (app.js renderModalFinder): the conditions on top, the matching characters under them */
.finder {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	padding: 8px 4px 6px;
}
.finderRow {
	display: flex;
	align-items: center;
	gap: 6px;
	width: 100%;
	max-width: 36em;
}
.finderRow select[data-fk="t"] {
	flex: 0 0 9.5em;
	width: 9.5em;
}
.finderRow [data-fk="v"] {
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
}
/* a search field like the modal's (#cms: input[type="search"]), as wide as the row; its looking glass is .finderIc, which becomes the ability's icon */
.finderRow input[data-fk="v"] {
	max-width: none;
	background-image: none;
	/* as tall as the remove button beside it (.finderX): the row stretches it, its own padding and min-height no taller */
	align-self: stretch;
	min-height: 0;
	padding-top: 0;
	padding-bottom: 0;
	box-sizing: border-box;
    font-size: 16px;
    line-height: normal;
	border-color: var(--border-control); /* (as .finder .pk; focused, the search fields' #60593e) */
}
/* the icon at the start of the field: the ability's, else the looking glass (app.js finderSetIcon) */
.finderIc {
	position: absolute;
	left: 0.3em;
	top: 50%;
	transform: translateY(-50%);
	width: 1.25em;
	height: 1.25em;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	z-index: 1;
}
.finderIc:empty {
	background: var(--searchGlass) center / 1em no-repeat;
}
.finderIc img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	margin: 0;
}
.finderBtns {
	display: flex;
	gap: 6px;
	margin-top: 2px;
}
.finder .pk {
	padding: 6px 10px;
	border: 2px solid var(--border-control);
	background-color: var(--surface-control);
	color: inherit;
	cursor: pointer;
}
.finder .pk:hover {
	background-color: var(--surface-control-active);
	border-color: var(--border-control-active);
}
.finder .finderX {
	padding: 4px 9px;
}
.finderHint,
.finderCount {
	margin: 8px 4px;
	color: var(--mut);
}
/* the rows are grids on smaller screens: the character on a line of its own, the matched abilities as wide as fit beside each other under it */
@media screen and (max-width: 1100px) {
	#cmp.modalabilityfinder tr {
		grid-template-columns: repeat(auto-fit, minmax(13em, 1fr));
	}
	#cmp.modalabilityfinder tr > .finderChar {
		grid-column: 1 / -1;
	}
	#cmp.modalabilityfinder tr > .finderCell {
		grid-column: auto;
	}
}

/* the finder's results: a tile for each character (the face, the name, then what matched) */
.finderTiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(10em, 1fr));
	gap: 8px;
	padding: 4px;
}
.finderTile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 8px 6px;
	border: 2px solid var(--border-control);
	background-color: var(--surface-control);
	text-align: center;
	min-width: 0;
}

.modalabilityfinder .mb {
    min-height: 100%;
}

/* the Ability finder has its own fields: no modal search box (app.js filterModalContent ignores it there) */
#cmp.modalabilityfinder #cms {
	display: none;
}
/* the Database page (view d) is a menu of links: no search box */
#cmp.modalWd #cms {
	display: none;
}

.modalabilityfinder #cmc {
    flex: 1;
}

.finderTile a {
	text-decoration: none;
}

.finderTile[hidden] {
	display: none;
}
.finderHas {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	font-size: 13px;
}
.finderBoon {
	display: flex;
	align-items: center;
	gap: 4px;
	background-color: var(--surface-boon-tint);
	padding: 1px 6px;
}

/* the boon buttons: one with the boon icon for each skill, lit while that boon is a condition */
.finderBtns {
	flex-wrap: wrap;
}
.finder .finderBoonBtn {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 3px 7px 3px 6px;
}
.finder .finderBoonBtn.on {
	background-color: var(--surface-boon-filter-on);
	border-color: var(--accent-gold);
}

/* the whole finder tile opens the character: the name's link covers it, the links of what matched stay above that */
.finderTile {
	position: relative;
	cursor: pointer;
}
.finderTile:hover {
	background-color: var(--surface-control-active);
	border-color: var(--border-control-active);
}
.finderTile > b a::after {
	content: '';
	position: absolute;
	inset: 0;
}
.finderTile .finderHas a {
	position: relative;
	z-index: 1;
}

/* the ability suggestions under a finder field (icon, name, kind) */
.finderRow {
	position: relative;
}
.finderSuggest {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 20;
	max-height: 18em;
	overflow-y: auto;
	background-color: var(--surface-suggest);
	border: 2px solid var(--border-control);
    margin-top: 4px;
}
.finderSuggest[hidden] {
	display: none;
}
.finderOpt {
	display: flex;
	align-items: center;
	gap: 6px;
	width: 100%;
	padding: 3px 8px;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}
.finderOpt:hover,
.finderOpt.on {
	background-color: var(--surface-control-active);
}
.finderOpt small {
	margin-left: auto;
	color: var(--mut);
	white-space: nowrap;
}

/* the finder tiles' ability links: the icon stays in the line (not floated, as in the lists) */
.finderTile .arrowLink > :is(img, .sw):first-child {
	float: none;
}

/* a finder tile with a spoiler in it is blurred as a whole (app.js tagSpoilers): what is hidden inside it doesn't add its own blur */
.finderTile[data-spoil] [data-spoil]::after {
	display: none;
}
html:not(.sp2) .finderTile[data-spoil="2"][data-spoil-ch]::after,
html:not(.sp3) .finderTile[data-spoil="3"][data-spoil-ch]::after,
html:not(.sw2) .finderTile[data-spoil="12"][data-spoil-ch]::after,
html:not(.sw3) .finderTile[data-spoil="13"][data-spoil-ch]::after {
	-webkit-backdrop-filter: blur(8px) grayscale(0.8);
	backdrop-filter: blur(8px) grayscale(0.8);
}

/* the map's path tabs: the character's icon (the tab's background-image, map.js renderTabs) instead of "<Name>'s path" */
#lma .lmPathTab {
	min-width: 2.5em;
	height: 2em;
	padding: 0 0.4em;
	box-sizing: border-box;
    background-size: auto 100%;
	background-position: center top;
	background-repeat: no-repeat;
}

/* the Part I tab (every path at once, map.js ALL): its own small icon, centred */
#lma .lmPathTab.lmAllTab {
	background-size: auto 75%;
	background-position: center;
}

#lma .lmPathTab[data-area="Part 3"] {
    background-position: -0.4em top;
    padding-left: 2.4em;
}

#lma .lmPathTab.on {
	box-shadow: 0 0 0 2px var(--accent-gold);
    border-color: transparent;
    background-origin: border-box;
}

@media screen and (max-width: 1000px), screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) { /* (and the portrait layout at every width: it is laid out at 800 px, index.html scaleToFit) */
	#bdb.pk {
		top: calc(32.6 * var(--vw));
        font-size: 12px;
		line-height: 100%;
	}
}

/* the Builder button on a small portrait screen: small, in the room under the spider chart (the narrow screen buttons are larger: .pk) */
@media screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) {
	/* (only on the abilities tab and the builder / build tabs, body.builder: the other tabs are one column, body.singleColumn, and cover where it is) */
	.singleColumn:not(.builder) #bdb {
		display: none;
	}

	.bcCreateP {
		margin: 8px;
		margin-left: 50%;
		margin-right: 0;
	}

	.pk.bcCreate {
		width: 100%;
	}

	#gfb svg {
		margin-right: -0.6em;
	}

	#gfb, #bttb, #cgb {
		letter-spacing: -.06em;
	}
}

/* the builder and build tabs on a small portrait screen (app.js tabUpdate: body.splitColumns, as singleColumn): two columns as the abilities
   tab's, the side one (.bcSide: Create a build, or the level / recruitment / class path; the disclaimer at its bottom) where its ability column
   is, the rest (.bcMain) beside it. The page does not scroll, only .bcMain does: the left column stays where it is. Elsewhere they are one
   column, the side part on top. */
@media screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) {
	/* the build page's class path pickers: the tier above its class button */
	.buildPage span.classPicker {
		flex-direction: column;
		margin-bottom: 6px;
    	align-items: flex-start;
	}

	.splitColumns .mainWrapper {
		padding-top: calc(var(--vw) * 6);
	}

	.splitColumns .tabContainer {
		display: grid;
		grid-template-columns: calc(30.1 * var(--vw)) minmax(0, 1fr);
		grid-template-rows: minmax(0, 1fr) auto; /* (the side part, then the disclaimer; .bcMain beside both) */
		column-gap: 0; /* (the spacing as the abilities tab's: none on the container, the columns' own padding) */
		height: 100%;
		overflow: hidden;
		scrollbar-gutter: auto; /* (.tabContainer keeps room for a scrollbar, even not scrolling: the page would be that much narrower; .bcMain has its own) */
		margin-left: 0;
		width: 100%;
		background: none;
		padding: 0;
	}

	/* (the page's own box drops out: its two parts are the grid's items) */
	.splitColumns .tabContainer > .statCalc,
	.splitColumns .tabContainer > .buildPage {
		display: contents;
	}

	/* the left column, padded as .grid2 (the abilities tab's left column) */
	/* (it takes the room down to the disclaimer and scrolls when its content is taller: a short screen, a long class path) */
	.splitColumns .bcSide {
		grid-column: 1;
		grid-row: 1;
		margin-top: calc(var(--vw) * 24);
		padding-left: 16px;
		padding-right: 10px;
		min-height: 0;
		overflow-y: auto;
		overflow-x: hidden;
		scrollbar-width: thin;
	}

	/* (the build page: its side part starts lower) */
	.splitColumns .buildPage > .bcSide {
		margin-top: calc(var(--vw) * 40);
	}

	.splitColumns .tabContainer > #disclaimer {
		grid-column: 1;
		grid-row: 2;
		margin-top: 0;
		padding-left: calc(1 * var(--vw));
		padding-right: 10px;
	}

	/* the right column: the one that scrolls (padded as #lt, the abilities tab's right column) */
	.splitColumns .bcMain {
		grid-column: 2;
		grid-row: 1 / 3;
		padding: 0 8px 10px;
		box-sizing: border-box;
		min-height: 0;
		height: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		scrollbar-gutter: stable;
	}

	/* (the build page's two groups: one under the other in the narrow column) */
	.splitColumns .bcCols {
		grid-template-columns: minmax(0, 1fr);
	}
	.splitColumns .bcCols .abGrp {
		display: contents;
	}
	.splitColumns .bcCols .ab.bcLate {
		order: 1;
	}

	.splitColumns .bcLevel {
		flex-wrap: wrap;
	}
}

/* the builder tab (app.js renderStatCalculator): the side part (.bcSide: Create a build, the level and the stats) is the first row of the tab and does not scroll, the main part
   (.bcMain: the reclass finder and the growth calculator, the disclaimer at its end) below it is what scrolls. The tab itself does not scroll; its page box (.statCalc) drops out,
   as in the split columns */
.singleColumn.builder:not(.splitColumns) .tabContainer {
	overflow: hidden;
    scrollbar-gutter: auto;

}
.singleColumn.builder:not(.splitColumns) .statCalc {
	display: contents;
}
.singleColumn.builder:not(.splitColumns) .bcSide {
	flex: none;
	margin-top: 12px; /* (what .tabContainer > :first-child had above the page) */
	position: relative;
	z-index: 2; /* (an open class list of it is over the main part) */
}
/* (the scrollbar at the tab's edge: the tab's right padding as a negative margin, and as padding, so the content stays where it was) */
.singleColumn.builder:not(.splitColumns) .bcMain,
.tabContainer > .tabMain {
	margin-right: calc(-1 * var(--tcPadR));
	padding-right: var(--tcPadR);
}
.singleColumn.builder:not(.splitColumns) .bcMain {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-gutter: stable;
    margin-right: calc(-1 * var(--tcPadR));
    padding-right: var(--tcPadR);
}
@media screen and (max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6) {
	.singleColumn.builder:not(.splitColumns) .bcSide {
		min-height: calc(23 * var(--vw));
		margin-top: 0; /* (its Create a build has its own margin here) */
	}
	.singleColumn.builder:not(.splitColumns) .bcMain {
    	background: var(--surface-page);
	}
}
/* below 1100px, outside the small portrait layout: the tab scrolls as a whole, the side part with the rest */
@media screen and (max-width: 1099px) and (not ((max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6))) {
	.singleColumn.builder:not(.splitColumns) .tabContainer {
		overflow-y: auto;
	}
	.singleColumn.builder:not(.splitColumns) .bcMain {
		flex: none;
		min-height: auto;
		overflow: visible;
		scrollbar-gutter: auto;
	}
}

/* the recruitment and liked gifts tabs (app.js fixTabTop), as the builder's: the buttons at the top (.tabFixed: Full recruitment list, Part I / Part III) are the first row of the tab
   and do not scroll, the rest (.tabMain, the disclaimer at its end) below them is what scrolls. Below 1100px, outside the small portrait layout, the tab scrolls as a whole */
.tabContainer:has(> .tabMain) {
	overflow: hidden;
	scrollbar-gutter: auto;
}
.tabContainer > .tabFixed {
	flex: none;
}
.tabContainer > .tabMain {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-gutter: stable;
    margin-right: calc(-1 * var(--tcPadR));
    padding-right: var(--tcPadR);
    margin-left: -16px;
    padding-left: 16px;
}
.tabContainer > .tabMain > * {
	flex-shrink: 0;
}
.tabContainer > .tabMain > #disclaimer {
	margin-top: auto;
}
@media screen and (max-width: 1099px) and (not ((max-width: 1100px) and (orientation: portrait) and (max-aspect-ratio: 5 / 6))) {
	.tabContainer:has(> .tabMain) {
		overflow-y: auto;
	}
	.tabContainer > .tabMain {
		flex: none;
		min-height: auto;
		overflow: visible;
		scrollbar-gutter: auto;
	}
}

/* the class at every level (app.js statCalcPlanHtml): a row for each level, scrolling */
.scPlanBox { margin: 6px; }
.scPlanBox>*:first-child {
	margin-right: 0.5em !important;
}

.scPlanWrap:not(.scResults) .gm { /* (the advanced mode table only: not the Yours / Expected / Difference one) */
    color: var(--text-plan-marker);
    font-weight: bold;
}

.scPlanWrap { margin: 6px 0; border: 1px solid var(--line); max-width: 55em; }
.scPlan { border-collapse: collapse; width: 100%; }
.scPlan th, .scPlan td { padding: 2px; text-align: center; border-bottom: 1px solid var(--line); font-weight: normal; white-space: nowrap; }
.scPlan thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-control); }
.scPlan th.scPlanLv { text-align: left; }
.scPlan th.scPlanLv > * { vertical-align: middle; }
.scPlan th.scPlanLv .scDd { margin-right: 2px; }
.scPlan .scDdBtn { padding: 1px 2px; }
.scPlan .scDdBtn .ci { margin: 0; height: 1.5em; width: 1.5em; }
.scPlan tr.on { background: var(--sel); }
/* (an open class / mount list: the tab above the card's buttons (#bdb, z-index 2) while it is open, its own z-index only counts inside the tab) */
.tabContainer:has(.scDdList:not([hidden])) { z-index: 3; }
/* (fixed lists: a plan row's, and the split view's left column's: their own width, not the page's) */
.scDd[data-plan] .scDdList, .splitColumns .bcSide .scDdList { z-index: 60; width: max-content; min-width: 0; max-width: calc(100vw - 8px); box-sizing: border-box; }
.scPlan th.scPlanLv .scDd {
    margin-right: 2px;
}

/* the plan's levels before the recruitment level: shown, not selectable */
.scPlan tr.pre {
    color: var(--mut);
}
.scPlan tr.pre .scDd { padding: 0 2px; }

/* a mount's icon in the plan, in the colour of the mount (app.js STAT_CALC_MOUNT_COLOURS) */
.mTint { display: inline-block; line-height: 0; background: var(--mc); isolation: isolate; vertical-align: middle; border-radius: 3px; }
.scDdList .mTint,
.scDdList>*>.ci.mi {
	margin: -1px 0  -1px -6px !important;
}
.mTint .ci { mix-blend-mode: multiply; margin: 0 !important; vertical-align: top;}
.mTint.mWhite .ci { filter: brightness(1.15); }

.modeExplanation {
	display: inline-block;
	margin-left: 8px;
}

.scDdBtn .mi.off {
	opacity: 0.3;
}

.scPlan .scDdBtn .ci.mi {
    height: 1.3em;
    width: 1.3em;
}
/* the results (Yours, Expected, Difference, Future): the plan's table, the labels in the first column */
.scResults .scPlan th.scPlanLv { width: 1%; }
.scResults .scPlan td { height: 2em; }
.scResults .scPlan tr:last-child td, .scResults .scPlan tr:last-child th { border-bottom: 0; }

/* the item popup (#idw): the popup is wider when it has a picture (hasPic); in portrait the picture goes under the text (.idPicEnd) and #idw scrolls */
#idw { display: flex; flex-direction: row-reverse; align-items: stretch; min-height: 0; flex: 1 1 auto; overflow: hidden; }
#idp #idw {
    overflow: auto;
    margin: 9px;
    margin-top: 0;
}
#idw > #idc { flex: 1 1 0; min-width: 0; }
#idp.hasPic .mb { width: min(820px, 100%); }


/* the item popup's picture is in its text twice (app.js buildItemDetail, opts.popup): in a wide view it is floated at the start of the text and the text flows around it (.idPicFloat);
   the one at the end (.idPicEnd) is the portrait view's, under the text (the portrait media query above) */
.idPicFloat, .idPicEnd { display: none; }

@media screen and (orientation: portrait), screen and (max-width: 700px) {
	#idp.hasPic .mb { width: min(560px, 100%); }
	#idp.hasPic #idw { flex-direction: column; align-items: stretch; overflow: auto;}
	#idp.hasPic #idw > #idc { flex: 0 0 auto; overflow: visible; max-height: none; padding-bottom: 4px;}
	.idPicEnd { display: block; padding-top: 6px; }
	.idPicEnd .idPic { margin: 0 auto; max-width: min(100%, 400px, 65vw, 65vh); height: auto; box-sizing: border-box; }
}

@media screen and (orientation: landscape) and (min-width: 701px) {
	#idc > .idPicFloat { display: block; float: left; box-sizing: border-box; width: min(32%, 400px); margin: 10px 10px 8px 0; 
        aspect-ratio: var(--ar);}
	#idc > .idPicFloat .idPic { display: block; margin: 0; max-width: 100%; height: auto; box-sizing: border-box; }
}

/* the rating lists of a meal or a gift (.idRatings) stay one block next to the floated picture: all of them beside it, or all of them under it, never one of them
   wrapped around it and the others not */
.idRatings { display: flow-root; }

/* the first child of the text gets #idc>*:first-child's top margin; the floated picture (.idPicFloat, hidden in portrait) is the first child now, so the element after it gets it too */
#idc > .idPicFloat + * { margin-top: 10px; }

/* the popup's picture, large (app.js: a click on .idPic): over the popup, a click closes it */
#idp .idPic, .lmItemDetail .idPic, #lmd .idPic { cursor: zoom-in; }
#idZoom { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 12px; box-sizing: border-box; background: rgba(0, 0, 0, 0.82); cursor: zoom-out; }
#idZoom img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border: 1px solid var(--line); background: var(--surface-modal); }

/* the vegetables, fish and meat lists (app.js renderModalFood): the name column wide enough for the icon and the longest name, the numbers narrow */
.foodName { min-width: 12em; white-space: nowrap; }
.foodTrait { padding-left: 4px; padding-right: 4px; white-space: nowrap !important; }

/* the food lists as tiles (app.js renderModalFood): the sort bar at every width, as it is on the small screens of the tables; the flavour small, after the name */
#cmp.modalTiles #sortBar:not(:empty) { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.itile .itFl { margin-left: auto; }

/* a place in a tile: the link is as tall as the line, aligned to its top (aligned to the text's bottom it stuck out below the line) */
.itile .itLocs .acqLoc a.loc { vertical-align: top; }

/* the food tiles: a place (with its chance) is one line, cut with an ellipsis */
.itile .acqLoc {
	white-space: nowrap;
    color: var(--mut);
}
.itile .acqLoc :is(.srcK, a.loc) { white-space: inherit; }

/* the scroll sources in a list's cell: a block, so its left margin moves every line (on an inline box only the first line moved, and the next ones stuck out to its left) */
#cmc small.scrollSources { display: block; }

/* a weapon's note under its description (weapons.json note) */
.idText.idWeaponNote { color: var(--mut); font-size: 13px; }

/* the link to the list of class minimums (app.js statCalcMinimumsHtml) */
.scMinimums { margin-top: 2px; }

.normalLink {
	color: var(--text);
}

.youtubeEmbed { /* (flow-root: beside a floating picture, not under it; too narrow there, it goes below the picture) */
	display: flow-root;
	min-width: min(240px, 100%);
	max-width: 450px;
	position: relative;
	aspect-ratio: 16 / 9;
	margin: 6px 0;
}

.youtubeEmbed iframe {
top: 0;
left: 0;
width: 100%;
height: 100%;
position: absolute;
border: 0;
}

.stbLevel>b {
	min-width: 8.5em;
    display: inline-block;
}

.mut {
	color: var(--mut);
}

.scSug small b {
	color: var(--fg);
}

.scSug .ci {
	height: 1.8em;
    width: auto;
    margin-right: 2px;
    margin-bottom: -0.3em !important;
}

.scSug {
	padding-bottom: 0.1em;
}

.scSug small {
    font-size: 0.95em;
    display: inline-block;
    margin-left: 2px;
}
/* a suggested class's skill requirements (app.js statCalcSugReqs), after its stat gains */
.scSug .requirementsWrapper, .scSug .smallRequirements { margin-left: 6px; white-space: nowrap; }

/* the class minimums list (app.js renderModalClassMinimums) on a small screen: the stats are one line, whatever the other lists' grids do.
   Up to 700px wide the class is in the first column of that line; on the smallest screens (700px and under) the class has the first row to itself and the nine stats are the second row */
@media screen and (max-width: 1100px) {
	#cmp.modalWq #cmc tr {
		grid-template-columns: minmax(0, 2.4fr) repeat(9, minmax(0, 1fr));
		align-items: center;
	}
	#cmp.modalWq #cmc tr > * {
		grid-column: auto;
		grid-row: auto;
		min-width: 0;
	}
}
@media screen and (max-width: 700px) {
	#cmp.modalWq #cmc tr {
		grid-template-columns: repeat(9, minmax(0, 1fr));
	}
	/* the class: the whole first row (the header row has no class cell: only the stats' line) */
	#cmp.modalWq #cmc tbody tr > .classNameField {
		grid-column: 1 / -1;
	}
	#cmp.modalWq #cmc thead tr > :first-child {
		display: none;
	}
	#cmp.modalWq #cmc tr > td.class-growth,
	#cmp.modalWq #cmc tr > th.class-growth {
		font-size: 12px;
		text-align: center;
		padding-left: 0;
		padding-right: 0;
	}
}

/* the start panel's links to searches (map.js quickLinks): one a line, with the location type's icon in front */
.lmQuick a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 3px;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
    color: var(--text);
}

.lmQuick a:first-child {
    padding-top: 0;
}

.lmQuick a:last-child {
    padding-bottom: 0;
}

.lmHint.lmQuick {
    border: 1px solid var(--line);
    padding: 4px;
    background-color: var(--surface-picture);
}

.lmQuick img {
	height: 1.2em;
	width: auto;
}
#lmb .lmQuickFace {
	height: 1.3em;
	width: 1.3em;
	object-fit: cover;
	border-radius: 50%;
	margin-right: 4px;
    vertical-align: -0.3em;
}

#lmb .lmQuickFace.lmAllFace {
	object-fit: contain;
	border-radius: 0;
}

/* the Part I tab (map.js renderInfo): what only some paths have, in a box for each group of paths, its heading their faces and types */
.lmPathBox {
	border: 1px solid var(--border, var(--border-path-box));
	padding: 4px 8px 6px;
	margin: 8px 0;
	clear: right; /* (below the picture at the top, map.js .lmShot: not beside it) */
}

.lmPathBox>.lmDesc {
    filter: none;
}

.lmPathBox>*:last-child {
    margin-bottom: 0;
}

.lmPathBox .lmSec:first-child {
    margin-top: 0;
}

.lmPathHead {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	font-weight: bold;
	margin-bottom: 2px;
}
#lmb .lmPathHead .lmQuickFace {
	margin-right: 4px;
}
.lmPathType {
	display: inline-flex;
	align-items: center;
	gap: 3px;
}
.lmPathType img {
	height: 1.4em;
	width: auto;
}
.lmNotOn .lmQuickFace {
	margin-left: 2px;
}

/* a dungeon's chest contents under its name in a location type's list (map.js dungeonChests) */
.lmFound li .lmChestList {
	flex-basis: 100%;
	margin: -2px 0 2px 1.6em;
}

/* a lord's face in front of their name in a location's How to find / Guide text (map.js withFaces; Eshmel's for "Part III") */
.lmMention {
	height: 1.3em;
	width: 1.3em;
	object-fit: cover;
	border-radius: 50%;
	vertical-align: -0.3em;
	margin-right: 3px;
}
.lmMention:has(+ a.qLink) { margin-right: 0; } /* (a paralogue's lord right before its quest link, the paralogue guide: no gap) */

/* selected text: the blue Chrome uses (white text on it), everywhere, the search boxes' text included */
::selection {
	background: var(--selection-bg);
	color: var(--text-selection);
	text-shadow: none;
}
::-moz-selection {
	background: var(--selection-bg);
	color: var(--text-selection);
	text-shadow: none;
}

/* a character's profile: the game's Personal History page (Layout Common_UnitInfoFull_Page04). Its colours as the game shows them: the titles and labels (T_Title,
   T_Info*) light tan, the values (T_Birthday, T_Txt...) cream; the career in the history frame (BgHistory: UnitInfoFull_FrmHistory, 1012 x 482: 10 rows of 48, the year
   column 91 wide; images/ui/prf-history.webp), each title over its gold rule (Common_BorderTitle, prf-rule.webp), each field over its line (Common_Border00, prf-line.webp),
   the crest in its box (BgClan: 172 x 138, the crest 138) */
.profileContainer {
	margin-top: 10px;
}



.prfCard {
	--prfLabel: #d5c5a8;
	--prfValue: #f8f0dc;
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 60em;
	line-height: 140%;
}
.prfHead {
	font-family: "Nocturne", serif;
	font-size: 1.25em;
	color: var(--prfLabel);
	letter-spacing: .06em;
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0 .55em;
	letter-spacing: .1em;
	text-shadow: 0 0 7px rgba(214, 186, 132, .22);
	padding: 0 12px 8px;
	background: url("../images/ui/prf-rule.webp") left bottom / auto 6px repeat-x; 
} /* (the glow: faint, it lifts the background next to the letters only a little) */
.prfHead > b { color: #f3e4c9; font-size: 1.3em; font-weight: normal; } /* (the colours: the brightest parts of the letters in the screenshot) */
.prfHead > span { color: #c1b39a; font-size: .95em; }
/* (the divider under the name and title: the game's title rule, Common_BorderTitle) and the scout blurb under it */
.prfIntro { margin: 0; padding: 0 12px; color: var(--prfValue); }
.prfHist {
	display: grid;
	grid-auto-rows: minmax(2.4em, auto);
	font-family: "Nocturne", serif;
	color: var(--prfValue);
	container-type: inline-size; /* (the year's size follows the frame's width: cqw) */
}
/* (each row: its own row of the frame (the picture's 10 rows: row --k stretched over this row), so the frame fits any number of rows and any row height; the year
   column is the frame's: 9% of its width, the year made smaller to fit it on a narrow screen) */
.prfHistRow {
	display: grid;
	grid-template-columns: 9% minmax(0, 1fr);
	align-items: center;
	background: url("../images/ui/prf-history.webp") 0 calc(var(--k) * 100% / 9) / 100% 1000% no-repeat;
}
.prfHistRow > b {
	font-weight: normal;
	font-size: min(1.1em, 3.3cqw);
	text-align: center;
}
.prfHistRow > span { padding: 2px 10px 2px 12px; }
.prfGrid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 24px;
}
.prfCol {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
}
.prfTitle {
	padding: 0 0 4px 12px;
	color: var(--prfLabel);
	background: url("../images/ui/prf-rule.webp") left bottom / auto 4px repeat-x;
}
.prfText {
	margin: 6px 0 0;
	padding: 0 12px;
	color: var(--prfValue);
}
.prfField {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	padding: 6px 12px 4px;
	background: url("../images/ui/prf-line.webp") left bottom / auto 4px repeat-x;
}
.prfField > span { color: var(--prfLabel); font-size: .95em; }
.prfField > b { color: var(--prfValue); font-weight: normal; font-family: "Nocturne", serif; font-size: 1.1em; text-align: right; }
.prfClan {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 0 0 12px;
}
.prfClan > b {
	color: var(--prfValue);
	font-weight: normal;
	font-family: "Nocturne", serif;
	font-size: 1.1em;
}
.prfCrest {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 86px;
	height: 69px;
	border: 2px solid #625f50;
	background: #15282d;
}
.prfCrest img { width: 69px; height: 69px; }

/* the extra close button on the map, over the zoom buttons (map.js #lmz [data-close]) */
#lmz #mapClose {
	font-size: 16px;
    position: relative;
	margin-bottom: 8px;
    border: 0;
    background: transparent;
}

#mapClose::before {
	inset: -5%;
}
/* the item's icon in front of its name, over its details in the map's item search (map.js renderFindList) */
.lmItemDetail > .calcTitle .lmIc {
    height: 1.2em;
    width: auto;
    vertical-align: text-bottom;
    margin-right: 4px;
}

/* the Part I tab: the paths a store item or merchant is limited to, as their faces after it (map.js tabSections onlyFaces) */
.lmOnlyOn {
	display: inline-flex;
	vertical-align: text-bottom;
}
#lmb .lmOnlyOn .lmQuickFace {
	height: 1.1em;
	width: 1.1em;
	margin-right: 1px;
}

/* the Part I tab, a location of one type: the paths' faces in front of the titles of what only they have (map.js renderInfo) */
.lmPathFaces {
	display: inline-flex;
	margin-right: 4px;
	vertical-align: text-bottom;
}
#lmb .lmPathFaces .lmQuickFace {
	margin-right: 2px;
}
/* in a section's title (its font 1.08em): the same size as the faces in a box's heading */
#lmb .calcTitle .lmPathFaces .lmQuickFace {
	height: calc(1.3em / 1.08);
	width: calc(1.3em / 1.08);
}

.levelButton .lmPathFaces {
    margin-top: -0.2em;
    margin-left: -0.3em;
}

h1 .calcTitle {
	margin-left: 0;
}

.calcTitle .lmPathFaces {
    margin-left: -1em;
}

.lmPathBox>.lmHint:last-child {
    margin-bottom: 0;
}
/* a shop's own price lower than the item's (map.js priceNote): the item's struck through, the shop's in bold */
.lmPrice s {
	opacity: 0.6;
    text-shadow: none;
    font-size: 0.92em;
    margin-right: 2px;
}

.lmPrice s .rnIc {
	display: none;
}

.lmPrice .lmSale {
	color: var(--fg);
	font-weight: bold;
}

/* ====================================================================== */
/* Quest popup (#idp.questPopup, app.js buildQuestDetail): the game's quest window (Common_QuestInfo). Its window, title line, rows' line and icons are the
   game's (images/quests/, fw-tools extract-ui.mjs); the Objective / Reward bars are drawn here in their colours (the game tints a plain shape)        */
/* ====================================================================== */
#idp.questPopup .mb { width: min(900px, 100%); }
/* every popup's window (#idp: items, units, quests): one picture of the game's nine pieces (Common_WdwInfo, corners 192 x 72), as a border image at the game's size (1:1),
   behind the content (z-index -1 in .mb's own stacking context; the size undoes .mb:before's top-picture height / width) */
#idp .mb::before {
	content: "";
	position: absolute;
	inset: -8px; /* (the picture's 8px glow outside the box: its solid edge on the box's edges) */
	width: auto;
	height: auto;
	box-sizing: border-box;
	z-index: -1;
	border-style: solid;
	border-width: 0;
	border-image: url(../images/quests/window.webp) 72 192 fill / 72px 192px; pointer-events: none;
	transform: none;
	background: none;
}
#idp.questPopup .mh { border-bottom: 0; margin: 0 15px; padding-bottom: 10px; position: relative; }
/* the title line: the game's double gold rule under the title (a 2px line, a 2px gap, a 1px line), fading out to the right; drawn here, not from its texture
   (FrmTitle: its glow and specks above the rule showed as broken bits of line) */
#idp.questPopup .mh::after { content: ""; position: absolute; left: 0; right: 25%; bottom: 2px; height: 5px; background: linear-gradient(var(--accent-quest), var(--accent-quest)) top / 100% 2px no-repeat, linear-gradient(var(--accent-quest), var(--accent-quest)) bottom / 100% 1px no-repeat; -webkit-mask: linear-gradient(to right, #000 60%, transparent); mask: linear-gradient(to right, #000 60%, transparent); opacity: .85; pointer-events: none; }
#idp.questPopup .idHead { gap: 6px; flex-wrap: nowrap; }
#idp.questPopup .idHead > span:not(.qHeadIc) { min-width: 0; }
.qTypeIc, .qKindIc { flex: none; }
#idp.questPopup .idHead h1 { font-family: "Nocturne", serif; }
/* the quest's icon before the title, the objective's kind after it (as the game shows them) */
.qHeadIc { display: contents; }
.qTypeIc { width: 40px; height: 40px; order: 0; object-fit: contain; } /* (a picture that is not square, a mentor's face: its own shape, not stretched) */
.idHead > span:not(.qHeadIc) { order: 1; }
.qKindIc { width: 22px; height: 22px; order: 2; opacity: .9; }
#idp.questPopup #idc { padding: 0 8px 16px; }
/* wide: the quest's texts (.qMain, then .qAfter: After completion) on the left, the map on the right, no higher than the window leaves room for (the
   popup's head and frame); one column: texts, map, After completion */
.qBody { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 18px; align-items: start; }
.qBody a {
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}

.qBody.hasMap { grid-template-columns: minmax(0, 1fr) min(40%, 360px, 100dvh - 150px); } /* (the map: up to 40% of the popup, 360px, and the height the popup leaves it: about 150px go to the head and frame) */
.qMain { grid-column: 1; grid-row: 1; min-width: 0; }
.qAfter { grid-column: 1; grid-row: 2; min-width: 0; }
.qSide { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 10px; padding-top: 10px; }
.qPaths { margin: 10px 0 0; }
/* the request in the giver's words, the giver under it after a line */
.qRequest { font-family: "Nocturne", serif; font-size: 16px; line-height: 1.45; color: var(--lighter); margin: 10px 4px 4px; }
.qRequest p { margin: 0 0 4px; }
.qGiver { margin: 4px 0 0; color: var(--text-quest-giver); font-size: 14px; }
.qGiver::before { content: ""; display: inline-block; width: 70px; height: 1px; margin-right: 8px; vertical-align: middle; background: currentColor; }
.qDone { margin: 4px 2px; font-size: 15px; }
/* the boxes: a beige bar with its title, a frame of a lighter teal */
.qBox { margin: 12px 0 0; border: 1px solid var(--border-quest-box); 
    background: var(--surface-quest-box); 
    box-shadow: 1px 1px 2px black; }
.qBoxHead { margin: 0; padding: 3px 14px; font-family: "Nocturne", serif; font-size: 15px; font-weight: normal; color: var(--text-quest-body); background: var(--border-quest-box); letter-spacing: .02em;}
.qBoxIn { padding: 8px 12px 10px; }
/* the objective's pills: a place, when it starts / ends (the game's dark rounded pills with an icon) */
.qPills { display: flex; flex-wrap: wrap; gap: 6px; }
.qPill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 6px; border-radius: 999px; background: var(--surface-inset); color: var(--text-quest-body); font-size: 14px; }
.qPill small { color: var(--text-quest-giver); font-size: 13px; }
.qPill .qIc { width: 20px; height: 20px; flex: none; }
p.qGoal { margin: 8px 2px 4px; color: var(--text-quest-body); } /* (the objective's goal text: p only, a quest's goal pin on the maps has the class too (.qPin.qGoal) and must not get its margin) */
.qLine { margin: 6px 2px 0; }
.qLine > small { color: var(--mut); }
.qLine .dropsContainer { margin-top: 4px; }
.qCount { font-variant-numeric: tabular-nums; margin-left: 1px; 
    color: var(--mut);
    font-size: 0.92em;} /* (a delivery's count, after the item's name: "Caltrop Flower ×5") */
.qGood { display: flex; align-items: center; gap: 6px; color: var(--text-quest-good); }
.qGood .qIc { width: 18px; height: 18px; }
/* requirements: a label column and its value */
.qReq { display: grid; grid-template-columns: 140px 1fr; gap: 8px; padding: 3px 0; align-items: baseline; }
.qReq > small { color: var(--mut); }
.qWarn { margin: 6px 0 0; color: var(--text-warning); font-size: 14px; }
/* the reward rows: icon, name, amount on the right, the game's thin line under each */
.qRew { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; max-width: 380px; padding: 5px 4px 6px; background: url(../images/quests/row-line.png) left bottom / 100% 2px no-repeat; font-size: 15px; }
.qRew > img, .qRew > .si, .qRew > svg { width: 22px; height: 22px; object-fit: contain; }
.qRewNum { font-variant-numeric: tabular-nums; font-size: 17px; }
.qRewName:only-child {
    grid-column: 1 / -1;
}
.qLink .si { width: 1.3em; height: 1.3em; vertical-align: -.25em; margin-right: 3px; }
/* the map: the site's tiles around the quest's places and their pins; a link to the map */
.qMap { display: block; position: relative; aspect-ratio: 1; container-type: inline-size; overflow: hidden; background: var(--surface-quest-map); border: 1px solid var(--border-quest-panel); box-shadow: inset 0 0 24px rgba(0, 0, 0, .45); }
.qMapIn { position: absolute; inset: 0; }
.qMapIn img { position: absolute; max-width: none; display: block; }
.qPin { position: absolute; width: 22px; height: auto; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 1; } /* (its width: app.js questMapHtml, the map's size at this zoom) */
.qPin.qGoal { z-index: 2; } /* the quest's own place: drawn as the selected one, over the others */
.qPin img { width: 100%; height: 100%; position: static; }
/* the quest's icon over its place's pin (the game's marker: its point on the pin) */
.qPin .qPinQuest { position: absolute; left: 50%; bottom: 60%; width: 9cqw; height: auto; aspect-ratio: 1; transform: translateX(-50%); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); } /* (a fixed share of the map, 9% of its width: not of its pin, whose size depends on the place's type) */
.qMap::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 18px 6px var(--shadow-quest-map); pointer-events: none; }
/* the inside of the place (app.js questHubMapHtml): the game's minimap (grey streets on its dark blue), the facilities' icons, the quest's icon on each spot it leads to */
.qHub { display: block; position: relative; aspect-ratio: 1; container-type: inline-size; overflow: hidden; margin-top: 10px; background: var(--surface-quest-hub); border: 1px solid var(--border-quest-panel); }
a.qHub { text-decoration: none; color: inherit; cursor: pointer; } /* (a step's inside map: a link to the place's location map) */
.qHubPic { height: auto; }
.qHub .qHubIc { width: 7cqw; height: auto; transform: translate(-50%, -50%); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.qHubGoal { position: absolute; width: 4cqw; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: var(--accent-quest-goal); box-shadow: 0 0 0 2px var(--glow-quest-goal-rim), 0 0 10px 3px var(--glow-quest-goal); z-index: 2; }
.qHubGoal .qPinQuest { position: absolute; left: 50%; bottom: 120%; width: 11cqw; height: auto; transform: translateX(-50%); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
.qHubGoal.qHubGiver { width: 3.4cqw; background: var(--accent-quest-giver); box-shadow: 0 0 0 2px var(--glow-quest-giver-rim), 0 0 8px 2px var(--glow-quest-giver); z-index: 1; } /* the client: a blue dot */
.qHubNote { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 5px; font-size: 13px; color: var(--text-quest-hub-note); }
.qHubKey { display: inline-flex; align-items: center; gap: 5px; }
.qHubKey small { color: var(--text-quest-hub-key); }
.qHubDot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-quest-goal); box-shadow: 0 0 4px var(--accent-quest-goal); }
.qHubDot.qHubGiver { background: var(--accent-quest-giver); box-shadow: 0 0 4px var(--accent-quest-giver); }
.qMap.qStepMap { width: min(100%, 240px); margin: 6px 0 10px; } /* a main quest step's small world map, as its inside map below */
.qHub.qHubStep { width: min(100%, 240px); margin: 6px 0 10px; } /* a main quest step's map, under the step */
.qGet { margin-top: 6px; } /* a quest's item to bring: how to get it, and its town's map (app.js deliverHtml) */
.qGet > small { display: block; opacity: .75; }
.lmHubFound { display: block; width: 100%; } /* the map search's Found at: the town's location map with its vendors, in the place's entry (map.js hubFoundHtml) */
.lmHubFound .qHub { width: min(100%, 240px); margin: 1px 0 2px; } /* (as small as a quest step's) */
.lmHubFound .qHubNote { display: none; } /* (no quest key: the entry above says which vendor) */
.qHubStepNote { margin: -6px 0 10px; }
.qStepIn { flex: 0 1 240px; width: min(100%, 240px); min-width: 0; } /* (its map is 100% of this: a flex item with no width of its own would be 0 wide) */
.qStepMaps { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 12px; } /* a step's two maps: the place on the world map and the inside map */
/* a step with two maps (the world map and the inside map): both keep the 240px height and share the width 50/50; each picture (.qMapIn) stays square and covers its box, cropped on the sides when the box is narrower than 240px */
.qStepMaps { flex-wrap: nowrap; }
.qStepMaps > .qMap.qStepMap, .qStepMaps > .qStepIn { flex: 1 1 0; width: auto; max-width: 240px; min-width: 0; } /* (50/50 of the space, never wider than 240px) */
.qStepMaps > .qMap.qStepMap, .qStepMaps > .qStepIn > .qHub.qHubStep { width: 100%; height: 240px; aspect-ratio: auto; }
.qStepMaps .qMapIn { inset: auto; left: 50%; top: 50%; width: max(100cqw, 240px); aspect-ratio: 1; transform: translate(-50%, -50%); container-type: inline-size; }
.qHubName { font-size: 14px; 
	filter: drop-shadow(0px 0px 1px black) drop-shadow(0px 0px 0px black);
}
.qHubName { position: absolute; left: 8px; bottom: 6px; z-index: 2; color: var(--text-quest-body);  pointer-events: none; }

@media screen and (orientation: portrait), screen and (max-width: 1000px) {
	/* Move the map to the bottom instead of the side in the quest modal*/
	.qBody, .qBody.hasMap { display: flex; flex-direction: column; align-items: stretch; }
	.qSide { position: static; flex: none; width: min(100%, 360px); margin: 12px auto 0; }
	.qReq { grid-template-columns: 110px 1fr; }
}

/* ====================================================================== */
/* The Database menu (app.js databaseMenu / dbMenuHtml) and its lists: Quests, Calendar, Tutorials (app.js renderModalQuests ...)            */
/* ====================================================================== */
/* four sections side by side (one under the other when there is no room): a heading that opens the list, its tabs under it */
.dbMenu { 
	flex-direction: row;
	flex-wrap: wrap;
	gap: 4px 0;
	padding: 0;
	max-width: min(100vw - 8px, 400px);
	max-height: 100vh;
	overflow: auto;
	box-sizing: border-box;
	background: none;
	box-shadow: 1px 1px 2px black, 2px 2px 3px black;
	border-style: solid;
	border-color: transparent;
	border-width: 10px;
	border-image: url(../images/menu/submenu-window.webp?h=e8c55fbb1d) 86 109 fill / 86px 109px / 46px repeat;
    background: linear-gradient(var(--surface-panel-dark), var(--surface-panel-dark)) 0 0 / 100% 100% no-repeat;
}
.dbSec { 
	display: flex; flex-direction: column;
	width: 100%;
}
.dbMenu a.dbHead {
	font-size: 16px;
	font-weight: bold;
    border-top: 1px solid;
    border-bottom: 1px solid;
    border-image: linear-gradient(90deg, #636352, #3f4741) 1;
	margin-bottom: 3px;
    position: relative;
    background: #716e642e;
}

.dbMenu .dbSec:first-child a.dbHead {
	border-top: 0;
}
.dbSubs { display: flex; 
    flex-wrap: wrap;}
.dbSubs>* {
    min-width: max(50%, 150px);
    box-sizing: border-box;
    flex: 1;
}
.dbMenu .dbSubs a {
	padding: 4px 6px 4px 12px;
	font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dbMenu .cbIcon { width: 1.3em; height: 1.3em; object-fit: contain; vertical-align: -0.3em; margin-right: 6px; }
/* a lord's face in the tabs and tiles */
.dbFace { border-radius: 50% !important; object-fit: cover !important; }
.dbLords .catTile .si { width: 34px; height: 34px; }
.catGrid.dbChapters { display: block; margin-bottom: 8px; } /* (a lord's chapters: one wrapping row of tiles, across the list) */
.dbChapters .catSubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.dbEmpty { padding: 10px; color: var(--mut); }
/* a list / popup waiting for its data (app.js LOADING_HTML): the spinner over the text, in the middle of the screen */
.dbLoading { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; pointer-events: none; color: var(--text); font-size: 18px; }
.dbLoading p { margin: 0; }
/* the calendar of a lord: a heading for each chapter (its dates), the weekdays, then its days as a calendar, a week a row (Monday first: app.js renderModalCalendar) */
.calChapter { margin: 4px 0 14px; scroll-margin-top: 6px; }
/* (the headings as the quest panel's (.qPaneHead): the Nocturne title, its small line under it, the accent line fading out under both) */
.calChHead { position: relative; margin: 6px 2px 6px; padding-bottom: 10px; font-family: "Nocturne", serif; font-size: 20px; font-weight: normal; color: var(--text); line-height: 1.25; }
.calChHead::after { content: ""; position: absolute; left: 0; right: 25%; bottom: 2px; height: 5px; background: linear-gradient(var(--accent-quest), var(--accent-quest)) top / 100% 2px no-repeat, linear-gradient(var(--accent-quest), var(--accent-quest)) bottom / 100% 1px no-repeat; -webkit-mask: linear-gradient(to right, #000 60%, transparent); mask: linear-gradient(to right, #000 60%, transparent); opacity: .85; pointer-events: none; }
.calChHead small { display: block; margin: 2px 0 0; font-family: inherit; color: var(--mut); font-size: 13px; }
.calChTitle { color: var(--text-cal-story); margin-left: 4px; }
/* a part (Part I, II, III) of a lord's calendar: its heading over its chapters / sections */
.calPartHead { position: relative; margin: 14px 2px 6px; padding-bottom: 10px; font-size: 24px; font-family: "Nocturne", serif; font-weight: normal; color: var(--accent-quest); }
.calPartHead::after { content: ""; position: absolute; left: 0; right: 25%; bottom: 2px; height: 5px; background: linear-gradient(var(--accent-quest), var(--accent-quest)) top / 100% 2px no-repeat, linear-gradient(var(--accent-quest), var(--accent-quest)) bottom / 100% 1px no-repeat; -webkit-mask: linear-gradient(to right, #000 60%, transparent); mask: linear-gradient(to right, #000 60%, transparent); opacity: .85; pointer-events: none; }
.calPartHead:first-child { margin-top: 2px; }
/* a chapter's days as a list (app.js calDaysHtml): a month heading, then a row a day: the date on the left (the number, the weekday under it), its lines beside it, each with a
   dot in its colour; the days with nothing on them one slim line */
.calDays { padding: 0 2px; }
.calDay .qIc {
    width: 1.3em;
}
.calMonthHead { margin: 12px 0 4px; padding-bottom: 2px; border-bottom: 1px solid var(--line); font-family: "Nocturne", serif; font-size: 15px; color: var(--mut); letter-spacing: .03em; }
.calDays > .calMonthHead:first-child { margin-top: 2px; }
.calSkip { height: 14px; margin: 2px 0; background: radial-gradient(circle, var(--mut) 1.5px, transparent 2px) center / 12px 100% repeat-x; opacity: .5; }
.calDay { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: start; gap: 10px; padding: 5px 8px; border-left: 3px solid transparent; }
.calDay:not(.calQuiet) { border-left-color: var(--accent-quest); margin: 2px 0; }
.calWeekend .calNum { color: var(--text-cal-birthday); }
.calDate { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.calNum { font-family: "Nocturne", serif; font-size: 20px; font-weight: normal; line-height: 1.15; }
.calWeekday { color: var(--mut); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.calQuiet { padding-top: 1px; padding-bottom: 1px; opacity: .55; }
.calQuiet .calNum { font-size: 14px; }
.calQuietRun .calDate { grid-column: 1; }
.calNone { color: var(--mut); font-size: 12px; font-style: italic; }
.calItems { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 2px; }
.calRow { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; min-width: 0; }
.calLine { display: inline-flex; align-items: center; gap: 0 5px; padding: 1px 8px 1px 6px; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); background: color-mix(in srgb, currentColor 9%, transparent); border-radius: 10px; }
.calLine::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.calLine small { opacity: .8; }
.calStory { color: var(--text-cal-story); }
/* the free time's start / end (app.js calendarDay, calRows: a row of their own, first): filled, bold, green when it begins, amber when it ends */
.calLine.calFree { font-weight: bold; font-size: 14px; letter-spacing: .02em; padding: 2px 12px 2px 8px; color: #10170f; border: 1px solid transparent; text-shadow: none; }
.calLine.calFree::before { background: currentColor; opacity: .7; }
.calLine.calFreeFrom { background: #7fcf85; border-color: #b6f0ba; box-shadow: 0 0 8px rgba(127, 207, 133, .45); }
.calLine.calFreeEnd { background: #e6a94f; border-color: #f7d49c; box-shadow: 0 0 8px rgba(230, 169, 79, .45); color: #1d1206; }
.calDeadline { color: var(--text-warning); font-weight: bold; }
.calBattle { color: var(--text-cal-battle); }
.calQuestEnd, .calMissable { color: var(--text-warning); }
.calBirthday { color: var(--text-cal-birthday); }
.calEvent { color: var(--text-cal-event); }
/* tutorials: a tile with its first picture; the popup's pages, each picture over its text */
.tutTile .tutThumb {
    width: 44%;
    flex: 0 0 44%; /* (Firefox shrinks a flex item's percentage width against the text next to it: each tile's picture a different size; fixed, as Chrome draws it) */
    min-width: 0;
    height: auto;
    aspect-ratio: 16 / 9;
    background: var(--surface-thumbnail);
    object-fit: cover;
    margin: -5px 5px -5px -5px;
    border: 1px solid var(--line);
}

.tutTile .itMain {
	flex-direction: row;
}

.tutTile .tutTextWrapper {
    display: flex;
    flex-direction: column;
}
/* a game tutorial or tip marked removed in the local editor (guides.json "removed"): no page on the site; on localhost it stays in the lists, dimmed, so it can be put back */
.tutRemoved { opacity: 0.45; }
.tutRemovedNote { color: var(--muted, #999); margin-right: 8px; }
.tutCat .si, .tutIc { width: 28px; height: 28px; object-fit: contain; } /* (a section's icon: the game's tab icon) */
.tutPage {
	margin: 10px 0; 
	color: var(--bCol);
}
.tutPage .idText {
	color: var(--bCol);
}
.tutPage b{
	color: var(--fg);
}

.guideAdd { margin: 0 0 10px; }
.guideAdd .qGuideEdit { margin: 0; padding: 2px 12px; font-size: 13px; opacity: .75; border-style: dashed; }
.guideAdd .qGuideEdit:hover { opacity: 1; }
.tutPage .idPic { display: block; max-width: min(400px, 50%); height: auto; margin: 8px auto; cursor: zoom-in; }
/* (every tutorial picture is 800 x 450: the box takes its size before the picture is in, no jump; width / height in the tag too) */
.tutPic {
	aspect-ratio: 16 / 9;
}

.tutPic, .tutPage .idPic { 
	cursor: zoom-in; display: block; max-width: min(400px, 40%); height: auto;
	margin: 0 8px 6px 0;
	border: 1px solid var(--line); background: var(--surface-thumbnail); 
	mask-image: none;
	float: left;
    clear: left;
    box-sizing: border-box;
}
/* a phone: the pictures in a row above the text (swiped sideways, the next one peeking in), not floated beside it: a column of pictures as tall as the guide
   left the text and tables a third of the width, a word per line; a picture in the text over it, full width */
@media screen and (max-width: 700px) {
	.tutPics { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 8px; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
	/* (the strip at most 40% of the screen's height: the width capped at that height × 16/9 (every picture is 16:9), the height follows it, the shape kept) */
	.tutPics .tutPic { float: none; flex: 0 0 auto; width: min(82%, 400px, 40vh * 16 / 9); max-width: none; margin: 0; scroll-snap-align: start; }
	.tutPics .tutPic:only-child { width: min(100%, 400px, 40vh * 16 / 9); }
	/* (a picture in the text: at most 40% of the screen's height too; width and height auto with both maxima: scaled down whole, whatever its shape) */
	.tutPage .idPic { float: none; width: auto; height: auto; max-width: min(100%, 400px); max-height: 40vh; margin: 8px auto; }
}

@media screen and (max-width: 700px) {
	.calDay { grid-template-columns: 44px minmax(0, 1fr); gap: 2px; }
	.calDate { flex-direction: column; gap: 0; }
}


@media screen and (max-width: 1000px) and (min-aspect-ratio: 205 / 100) {
	.dbMenu {
		max-width: 82%;
		flex-direction: column;
	}

	.dbMenu a.dbHead {
		border-top: 0;
		border-image: none;
		border-color: #636352;
        padding-right: 15px;
	}

	.dbMenu .dbSec:last-child .dbSubs a {
		padding-right: 12px;
	}

	.dbSec {
		max-width: 80%;
		flex-direction: column;
        min-width: 140px;
        flex: 1;
		margin-bottom: 5px;
		width: auto;
	}

	.dbSubs {
    	flex-direction: column;
	}

	#gfb .moreArrow {
		transform: rotate(-90deg);
	}
}

/* the Database page (/database/: app.js view d): the menu's four sections side by side, as the drop-down */
.dbPage { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 6px 0; }
.dbPage .dbSec { flex: 1 1 200px; }
.dbPage a { display: block; padding: 5px 6px; color: var(--text); text-decoration: none; }
.dbPage a:hover, .dbPage a:focus-visible { background: var(--surface-control-active); outline: none; }
.dbPage a.dbHead { font-size: 17px; font-weight: bold; border-bottom: 1px solid var(--line); margin-bottom: 3px; }
.dbPage .dbSubs a { padding-left: 12px; font-size: 15px; }
.dbPage .cbIcon { width: 1.3em; height: 1.3em; object-fit: contain; vertical-align: -0.3em; margin-right: 6px; }

/* a tutorial only on some paths: their faces before its title (the list's tiles) and its Shown line (the popup) */
.tutFace { display: inline-block; width: 22px; height: 22px; margin-right: 4px; vertical-align: -5px; border-radius: 50%; background: center / cover no-repeat; flex: none; }

/* a main quest's steps (app.js buildMainQuestDetail): the objectives the game shows, in order */
.qSteps { margin: 8px 0 2px 20px; padding: 0; color: var(--text-quest-body); }
.qSteps li { margin: 2px 0; display: block;}
/* an icon in a chip of the quest popup (a main quest's battles) */
.qBox .idChip .qIc { width: 18px; height: 18px; vertical-align: -4px; margin-right: 4px; }

/* a quest's paths (app.js buildQuestDetail: Paths, Resets on): each lord's small face before the path's name */
.qPath { white-space: nowrap; margin-right: 8px; }
.qFace { 
    width: 18px;
    height: 18px;
	margin: 1px 0;
    margin-right: 4px;
    vertical-align: text-bottom;
    border-radius: 50%;
    display: inline-block;
    background: center / cover no-repeat; /* (a span with the face as its background: app.js faceSpan) */
    flex: none;
}
.prfTabFace { margin: -4px 0 -4px 6px; } /* (a profile tab's lord: the button keeps its height) */
.qFace.qAll { border-radius: 0; background-size: contain; } /* (the map's All icon: not a round face) */
.qPathFaces { white-space: nowrap; } /* (a path specific quest in a How to get / Used for list: its paths' faces before its name) */
.qPathFaces .qFace { margin-right: 2px; }
/* (a path it is not on, app.js pathFacesHtml: the lord's face with the game's impassable mark in its bottom right corner) */
.qFace.qNot, .tutFace.qNot { position: relative; }
.qFace.qNot::after,
.tutFace.qNot::after {
    content: '';
    position: absolute;
    right: -2px;
    bottom: -1px;
    width: 50%;
    height: 50%;
    background: url(../images/map/state_impassable.png) center / contain no-repeat;
    pointer-events: none;
}

.qPathFaces .qFace:last-child {
    margin-right: 0;
}

.qPathFaces + a { margin-left: 2px; }
/* (the how to get lists, app.js howToFull: an entry's different rows a line each; the faces of who carries it) */
.htFull .htLine { display: block; padding-left: 22px; }
.acqLoc > .htLine { display: block; }
/* (the faces as tall as the line, so they move nothing on it) */
.acqLoc > .qPathFaces .qFace, .htLine > .qPathFaces .qFace { width: 18px; height: 18px; margin-top: -3px; margin-bottom: -1px; vertical-align: middle; }
.htLine > .qPathFaces { margin-right: 4px; }
.acqLoc > .qPathFaces { display: inline-block; vertical-align: top; margin-right: 3px; }
.htThumbs { display: flex; flex-wrap: wrap; gap: 2px; margin: 2px 0; }

/* the renown icon before a renown requirement (app.js RENOWN_ICON) */
.rnIc {    
	width: 1em;
    height: 1em;
    vertical-align: -0.17em;
    object-fit: contain;
	margin-right: 1px;
}
.goldN { white-space: nowrap; color: var(--text-gold); } /* (a price: the icon, images/ui/icon-gold.png in the same colour, stays with its number) */
/* a wandering merchant's money bag (How to get, app.js howToName): the game's white IconPageTab_Tool as a mask, filled with the gold icon's colour; a place's icon size (.locIc) */
.htMerchIc { display: inline-block; width: 1em; height: 1em; margin-right: 3px; vertical-align: text-bottom; background: var(--text-gold);
	-webkit-mask: url(../images/hub/icons/IconPageTab_Tool.webp) center / contain no-repeat; mask: url(../images/hub/icons/IconPageTab_Tool.webp) center / contain no-repeat; }
.qRew:has(> img[src*="icon-gold"]) .qRewNum, .qRowRewItem:has(> img[src*="icon-gold"]) { color: var(--text-gold); } /* (a quest's gold reward) */
.lmRepairRew { display: inline-flex; flex-wrap: wrap; gap: 0 12px; }
#lmd .lmSec.lmRepairRews { clear: none; margin: 8px 0 0; } /* (inside the repair materials' box, beside the picture as it is) */
.rnLv { white-space: nowrap; }
.rnLv small { font-size: 0.85em; }
/* the recruitment All tab: a path's face with its support hearts, kept together */
.rcLord { white-space: nowrap; }
.rcLord .qFace {
    margin-right: 0;
}
/* a stat box's icon (app.js STAT_ICON / statBoxAttr): the game's stat icon (images/stat-icons, white) as a faint gold shape behind the label and value */
.idStats span.stIc { position: relative; isolation: isolate; }
.idStats span.stIc::before { 
	content: "";
	position: absolute;
    left: 0;
    top: 0;
    width: 1.2em;
    height: 1.2em;
    z-index: -1;
    pointer-events: none;
    background-color: var(--icon-stat);
    opacity: 0.7;
    -webkit-mask: center / contain no-repeat;
    mask: center / contain no-repeat;
    margin-right: -1.2em;
    margin-bottom: -0.8em;
}

.skDet .idStats span.stIc::before {
	position: relative;
	content: "";
    margin-right: -1.2em;
    margin-bottom: -0.8em;
    transform: translate(-50%, -50%);
}

.idStats span.st-mt::before { -webkit-mask-image: url(../images/stat-icons/mt.png); mask-image: url(../images/stat-icons/mt.png); }
.idStats span.st-hit::before { -webkit-mask-image: url(../images/stat-icons/hit.png); mask-image: url(../images/stat-icons/hit.png); }
.idStats span.st-crit::before { -webkit-mask-image: url(../images/stat-icons/crit.png); mask-image: url(../images/stat-icons/crit.png); }
.idStats span.st-rng::before { -webkit-mask-image: url(../images/stat-icons/rng.png); mask-image: url(../images/stat-icons/rng.png); }
.idStats span.st-avo::before { -webkit-mask-image: url(../images/stat-icons/avo.png); mask-image: url(../images/stat-icons/avo.png); }
.idStats span.st-hp::before { -webkit-mask-image: url(../images/stat-icons/hp.png); mask-image: url(../images/stat-icons/hp.png); }
.idStats span.st-str::before { -webkit-mask-image: url(../images/stat-icons/str.png); mask-image: url(../images/stat-icons/str.png); }
.idStats span.st-mag::before { -webkit-mask-image: url(../images/stat-icons/mag.png); mask-image: url(../images/stat-icons/mag.png); }
.idStats span.st-dex::before { -webkit-mask-image: url(../images/stat-icons/dex.png); mask-image: url(../images/stat-icons/dex.png); }
.idStats span.st-spd::before { -webkit-mask-image: url(../images/stat-icons/spd.png); mask-image: url(../images/stat-icons/spd.png); }
.idStats span.st-lck::before { -webkit-mask-image: url(../images/stat-icons/lck.png); mask-image: url(../images/stat-icons/lck.png); }
.idStats span.st-def::before { -webkit-mask-image: url(../images/stat-icons/def.png); mask-image: url(../images/stat-icons/def.png); }
.idStats span.st-res::before { -webkit-mask-image: url(../images/stat-icons/res.png); mask-image: url(../images/stat-icons/res.png); }
.idStats span.st-cha::before { -webkit-mask-image: url(../images/stat-icons/cha.png); mask-image: url(../images/stat-icons/cha.png); }
.idStats span.st-as::before { -webkit-mask-image: url(../images/stat-icons/as.png); mask-image: url(../images/stat-icons/as.png); }
.idStats span.st-prt::before { -webkit-mask-image: url(../images/stat-icons/prt.png); mask-image: url(../images/stat-icons/prt.png); }
.idStats span.st-rsl::before { -webkit-mask-image: url(../images/stat-icons/rsl.png); mask-image: url(../images/stat-icons/rsl.png); }

/* the Quests list (app.js renderModalQuests): a chapter's quests, a heading above each chapter's (shown while searching: every chapter with a match) */
/* a search (app.js questElsewhere): the shown chapter's matches are the list, the matches in other chapters and paths are links under it */
.qElsewhere { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 4px 4px; }
.qElsewhere:empty { display: none; }
.qList .qGroup:not([hidden]) + .qElsewhere:not(:empty), .qList .qElsewhere:not(:empty) { margin-top: 10px; border-top: 1px solid var(--border-control); }
.qHit { font-family: "Nocturne", serif; font-size: 15px; color: var(--text-quest-hit); text-decoration: underline dotted; text-underline-offset: 3px; }
.qHit:hover { text-shadow: var(--glow); }.qNone { margin: 0; color: var(--mut); font-size: 14px; }
/* the chapter navigation, above the list (with the chapter's title) and under it: the chapter before, the chapter, the one after */
.qNav { flex: none; padding: 5px 5px 6px; }
.qNav[hidden] { display: none; }
.qTabs + .qNav { border-bottom: 1px solid var(--border-control); } /* (under the paths' faces, above the list) */
.qNavRow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.qNavCur { font-family: "Nocturne", serif; font-size: 17px; font-weight: normal; text-align: center; white-space: nowrap; }
/* the previous / next chapter: the modal tabs' selected style (the end caps and the stretched middle, as the header's selected tab; its caps scale with --tabH) */
.qNavBtn { opacity: 0.75; --tabH: 34px; --capW: calc(var(--tabH) * 20 / 36); position: relative; z-index: 0; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: var(--tabH); padding: 0 var(--capW); border: 2px solid transparent; /* (the 2px border the tabs have: the caps cover it, the mirrored one is placed by it) */
	font-family: "Nocturne", serif; font-size: 15px; text-decoration: none; white-space: nowrap; }
.qNavBtn::before, .qNavBtn::after { content: ""; position: absolute; top: -2px; bottom: -2px; left: -2px; right: calc(50% - 1px); background: url(../images/ui/PageTabTxt_KeyHelpFrm_Half.webp) left center / auto 100% no-repeat; z-index: -1; pointer-events: none; } /* (the halves of the pill, as the selected tab's) */
.qNavBtn::after { left: calc(50% - 1px); right: -2px; transform: scaleX(-1); }
a.qNavBtn:hover { text-shadow: var(--glow); }
.qNavBtn.off { visibility: hidden; } /* (the first / last chapter has none before / after: its place stays empty) */
/* the navigation's labels carry the part ("Part I: Chapter 4 »"): on a narrow sidebar (a phone; the usual width beside the quest) the two buttons share a row, the title under them */
.qSideCol { 
	container-type: inline-size; 
	--frm: 1;
}
@container (max-width: 620px) {
	.qNavRow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 6px; }
	.qNavRow .qPrev { grid-column: 1; grid-row: 1; }
	.qNavRow .qNext { grid-column: 2; grid-row: 1; }
	.qNavRow .qNavCur { grid-column: 1 / -1; grid-row: 2; }
	.qNavBtn { --tabH: 30px; font-size: 13px; }
}
.qNavBtn.qPrev { justify-self: start; }
.qNavBtn.qNext { justify-self: end; }
.qNavTitle { 
    text-align: center;
    font-family: "Nocturne", serif;
    font-size: 14px;
    color: var(--bCol);
    padding: 0 4px;
    margin-top: -2px;
    margin-bottom: -1px;
}

.qNavMid {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* a lord's quest list (app.js renderModalQuests), as the game's quest menu: the list on the left (the search box at its top, the chapters' links, every quest as a row
   under its chapter), the chosen quest on the right as its popup shows it; each side scrolls on its own. Narrow / portrait: the list alone, a row opens the popup */
#cmc:has(> .qSplit), #cmc:has(> .calWin) {
	flex: 1; min-height: 0; overflow: hidden; display: flex; 
    margin: 0;
	padding: 0;
}

.qSplit { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(340px, 36%) minmax(0, 1fr);
}/* the Quests modal's own look: no list window around the whole of it (the tab bar stays); the list in the game's list window (the frame the other lists have,
   images/ui/list-window.webp, at the modal's size --frm), the quest beside it in the popup's frame (.qPane) */
#cmp.modalWx .mb, #cmp.modalWy .mb { background: none; padding: 0px; }
#cmp.modalWx .mb::before, #cmp.modalWy .mb::before { content: none; }
#cmp.modalWx #cmx, #cmp.modalWy #cmx {
	top: 6px;
	right: 6px;
}
/* a close button with one size and place at every width (.closeFixed: the map's #lmx, the Quests and Calendar lists' #cmx (app.js renderModal)): not the smaller
   buttons and pulled-in corners the other lists get below 1100px / 900px. (:is(#cmx, #lmx): above button#cmx's own rules) */
:is(#cmx, #lmx).closeFixed { --dim: 60px; margin: 0; }
/* no header (its title and tabs: the tabs are in the list's box): only the close button, where it always is (absolute, at the top right) */
#cmp.modalWx .mh, #cmp.modalWy .mh { min-height: 0; height: 0; padding: 0; margin: 0; } /* (across the whole window, from its top: the button in its corner, as on the other lists) */
#cmp.modalWx .mh::before, #cmp.modalWy .mh::before { content: none; }
#cmp.modalWx #cmn, #cmp.modalWy #cmn { display: none; }
.qSideCol { position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: 0; padding: calc(16px * var(--frm, 1)) calc(16px * var(--frm, 1)) calc(18px * var(--frm, 1));
	background: linear-gradient(var(--surface-panel-dark), var(--surface-panel-dark)) calc(8px * var(--frm, 1)) calc(8px * var(--frm, 1)) / calc(100% - 16px * var(--frm, 1)) calc(100% - 16px * var(--frm, 1)) no-repeat; }
.qSideCol::before { 
	content: ""; 
	position: absolute; 
	inset: 0; 
	z-index: -1; 
	box-sizing: border-box; 
	pointer-events: none; 
	border-style: solid;
	border-width: 0;
	border-image: url(../images/ui/list-window.webp) 152 72 72 120 fill / calc(152px * var(--frm, 1)) calc(72px * var(--frm, 1)) calc(72px * var(--frm, 1)) calc(120px * var(--frm, 1)); 
}
.qSearchSlot {
	flex: none;
	padding: 6px 4px 2px; 
    margin: 0 auto;
}
/* the paths' tabs, in the list's box above its chapters (a copy of the header's, app.js renderModal; the header's hidden) */
#cmp.modalWx #cmn .mTabList { display: none; }
/* (icons only, as the map's path tabs: a path's round face, the All icon; the selected one ringed in gold) */
.qTabs { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 4px; }
.qTabs a { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 3px; box-sizing: border-box; border: 2px solid transparent; border-radius: 50%; background: var(--surface-quest-tab); }
.qTabs a:hover { background: var(--surface-quest-tab-hover); }
.qTabs a.on { border-color: var(--accent-quest); background: var(--surface-quest-selected); box-shadow: 0 0 6px var(--glow-quest-tab-selected); }
.qTabs a img { width: 100%; height: 100%; margin: 0; object-fit: cover; border-radius: 50%; }
.qTabs a img.qAllIc { 
    object-fit: contain !important;
    border-radius: 0 !important;
}
.qSearchSlot #cms { width: 100%; max-width: none; min-width: 0; box-sizing: border-box; }
.qList { 
	flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 12px 12px;
    padding-bottom: 8px;
    margin-bottom: 4px;
    padding-right: 8px;
    margin-right: 4px;
}
.qGroup[hidden] { display: none; }
/* a row: the game's framed line, its icon and name; the chosen one lighter, with a gold frame */
.qRow.itile { display: block; margin: 0 0 4px; padding: 0; gap: 0; text-align: left; border: 1px solid var(--border-quest-row); background: var(--surface-quest-tab); } /* (.itile's tile layout undone: a row) */
.qRow.itile[hidden] { display: none; }
.qRow.itile .itMain { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; gap: 8px; padding: 6px 10px; text-decoration: none; font-family: "Nocturne", serif; font-size: 16px; line-height: 1.25; }
.qRow .itMain .si { width: 26px; height: 26px; flex: none; }
.qRow.itile:hover { background: var(--surface-quest-tab-hover); }

@media screen and (orientation: landscape) and (min-width: 801px) {
	/* We only show this when the side bar exists*/
	.qRow.itile.on { 
		background: var(--surface-quest-selected); 
		border-color: var(--border-quest-selected); 
		box-shadow: inset 0 0 0 1px var(--glow-quest-row-selected); 
	}
}

.qRowName { min-width: 0; }
/* the name, and its rewards under it on one line (cut with an ellipsis when long): the game's small icons, gold and renown first */
.qRowText {
    margin: -3px 0; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.qRowRew { display: block; margin-top: -1px; font-size: 12.5px; line-height: 1.3; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qRowRewItem { display: inline-flex; align-items: center; gap: 3px; margin-right: 10px; vertical-align: middle; }
.qRow .itMain .qRowRew img:not(.qFace) { width: 15px; height: 15px; margin: 0; flex: none; object-fit: contain; } /* (a character's face is a qFace, its own size) */
.qRowRew .qFace { flex: none; margin-right: 0; }
.qRow .itMain .qRowRew img.ci { width: 18px; height: 18px; margin: 0; } /* (a class's icon: a little larger, its picture is small) */
.qRowFaces { display: inline-flex; gap: 2px; flex: none; margin-right: -2px; } /* (the All tab: a quest of only some paths, their lords' faces before its name) */
.qRowFaces .qFace { width: 22px; height: 22px; }
.qRowMeta { display: none; } /* (in the row for the search only) */
/* a quest's guide (app.js questGuideBox): a box before the Objective, as the others; its paragraphs, its pictures (the map's .idPic) and item links. The Edit button is only on localhost
   (QUEST_EDIT; the editor is data/quest-editor.js): in the box's title, at its end; with no guide, a button of its own */
.qGuide .qBoxHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qGuideEdit { margin-left: auto; padding: 0 10px; font-size: 12px; line-height: 1.6; }
.qGuideEmpty { margin: 12px 0 0; }
.qGuideEmpty .qGuideEdit { margin: 0; padding: 2px 12px; font-size: 13px; opacity: .75; border-style: dashed; }
.qGuideEmpty .qGuideEdit:hover { opacity: 1; }
/* a step's guide (key <slug>#<step>), at the end of the step in the quest's list of steps */
.qSteps li .qGuideStep { 
    margin: 6px 0 10px;
    list-style: none;
    margin-left: -29px;
    margin-right: -9px;
    box-shadow: none;
}

.qSteps li .qGuideStep .qBoxIn {
	padding-bottom: 4px;
}

.qSteps li .qGuideEmpty.qGuideStep { margin: 4px 0 8px; }
.qGuideP { margin: 0 0 8px; line-height: 1.45; }
.qGuideP:last-child { margin-bottom: 0; }
.qGuide .idPic { display: block; max-width: 100%; height: auto; margin: 8px auto; cursor: zoom-in; }
.qGuide .lmItem { text-decoration: underline dotted; text-underline-offset: 2px; }
.qGuide .lmItem .si { width: 1.2em; height: 1.2em; margin-right: 3px; vertical-align: text-bottom; }

.qGuide .idPic {
    max-width: min(20em, 100%);
}

/* a quest that can be missed: the game's clock (as its "End" pill) at the end of the row, its reason as the tooltip */
.qRowMiss { margin-left: auto; flex: none; display: inline-flex; align-items: center; opacity: .8; }
.qRowMiss .qIc { width: 18px; height: 18px; }
/* the chosen quest: the popup's head (its icon, the title in the game's font, the gold rule under it) and its content */
/* (the popup's frame: the game's info window, images/quests/window.webp, as #idp .mb::before; on the pane, which stays still, its title too: its content scrolls in .qPaneBody) */
.qPane { position: relative; isolation: isolate; min-height: 0; display: flex; flex-direction: column; background: linear-gradient(var(--surface-panel-dark), var(--surface-panel-dark)) 8px 8px / calc(100% - 16px) calc(100% - 16px) no-repeat;
    margin: 6px; }
.qPane::before { content: ""; position: absolute; inset: -8px; /* (the picture's 8px glow outside: its solid edge on the pane's edges) */ z-index: -1; box-sizing: border-box; pointer-events: none; border-style: solid; border-width: 0; border-image: url(../images/quests/window.webp) 72 192 fill / 72px 192px; } /* (no real border: see #idp .mb::before) */
.qPaneIn { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px 24px 18px; }
/* (the quest's own part scrolls, under the title that stays; it reaches the padding's edges, so its scrollbar is where the pane's was) */
.qPaneBody { 
	flex: 1; 
	min-height: 0; 
	overflow-y: auto;
    margin: 0 -15px -9px 0;
    padding: 0 15px 9px 0;
}
.qPaneHead { position: relative; flex: none; margin: 0 0 4px; padding-bottom: 10px; gap: 6px; flex-wrap: nowrap; }
.qPaneHead > span:not(.qHeadIc) { min-width: 0; }
.qPaneHead h1 { font-family: "Nocturne", serif; font-size: 20px; font-weight: normal; }
.qPaneHead::after { content: ""; position: absolute; left: 0; right: 25%; bottom: 2px; height: 5px; background: linear-gradient(var(--accent-quest), var(--accent-quest)) top / 100% 2px no-repeat, linear-gradient(var(--accent-quest), var(--accent-quest)) bottom / 100% 1px no-repeat; -webkit-mask: linear-gradient(to right, #000 60%, transparent); mask: linear-gradient(to right, #000 60%, transparent); opacity: .85; pointer-events: none; }
@media screen and (orientation: portrait), screen and (max-width: 800px) {
	/* (the list's box fills the window's height, as on a wide screen: the search, the chapter buttons and the paths stay in view, only the quests scroll) */
	.qSplit { display: flex; }
	.qSideCol { flex: 1; min-width: 0; }
	.qSearchSlot { padding: 4px 40px 8px 0; border-bottom: 0; } /* (the close button is at the corner: the search ends before it) */
	.qMissBar .qSearchSlot { padding: 0; } /* (beside the Missable only switch, under the chapter buttons: not at the corner) */
	.qList { overflow-y: auto; padding: 0 4px; }
	.qPane { display: none; }
}

#cmp { 
	padding: 0;
}


.mb { 
	background: linear-gradient(var(--surface-panel-dark), var(--surface-panel-dark)) calc(8px * var(--frm)) calc(8px * var(--frm)) / calc(100% - 16px * var(--frm)) calc(100% - 16px * var(--frm)) no-repeat; isolation: isolate; 
	padding: 8px;
}

body {
	--frm: 1;
}

.mb::before,
#spp .mb::before { 
	content: "";
	position: absolute; 
	inset: 0;
	width: auto;
	height: auto;
	box-sizing: border-box;
	z-index: -1;
	transform: none;
	background: none;
	pointer-events: none;
	border-style: solid;
	border-width: 0;
	border-image: url(../images/ui/list-window-tab-full.webp) 152 72 72 120 fill / calc(152px * var(--frm)) calc(72px * var(--frm)) calc(72px * var(--frm)) calc(120px * var(--frm));
    border-color: transparent;
}

#spp .mh {
	background: transparent;
	filter: none;
}

.qSideCol::before {
    border-style: solid;
    border-width: 0;
    border-image: url(../images/ui/list-window-tab-full.webp) 152 72 72 120 fill / calc(152px * var(--frm)) calc(72px * var(--frm)) calc(72px * var(--frm)) calc(120px * var(--frm));
}

@media screen and (max-width: 1100px) {
	#cmx, #mx {
		margin-right: -5px;
		margin-top: -5px;
	}

	body {
		--frm: 0.75;
	}

	/* (not the map's: its frame stays the full one until its compact layouts, where it gets this one (its compact block); :where keeps .mb::before's specificity) */
	.mb:not(:where(#lmp .mb))::before {
		border-width: calc(152px * var(--frm, 1)) calc(72px * var(--frm, 1)) calc(72px * var(--frm, 1)) calc(120px * var(--frm, 1));
		border-image: url(../images/ui/list-window.webp) 152 72 72 120 fill / calc(152px * var(--frm, 1)) calc(72px * var(--frm, 1)) calc(72px * var(--frm, 1)) calc(120px * var(--frm, 1)); 
	}

	#cmc, #mc {
		margin-left: 6px;
		margin-right: 6px;
		padding-left: 6px;
		padding-right: 6px;
	}
}

@media screen and (max-width: 900px) {
	body { 
		--frm: 0.5;
	}

	/* (the map's header and #lmb margin: only in its compact layouts (max-width 900px / max-height 500px), the block of its own) */

	button#cmx, button#mx {
    	--dim: 47px;
	}

	#cmc, #mc {
		margin-left: 0;
		margin-right: 0;
		padding-left: 4px;
		padding-right: 4px;
	}

	:is(#cmn, #mtb) .pk {
		font-size: 14px;
	}

	#cmp .mh, #md .mh {
    	padding-right: 36px;
        min-height: 40px;
		padding-top: 4px;
		padding-bottom: 5px;
	}

	.mh:not(:where(#lmp .mh)) { /* (:where: the specificity of .mh, as before) */
		padding-left: 2px;
		padding-bottom: 4px;
		padding-top: 5px;
	}
}

#cmp .mb::after { content: none; }

.qChapterWrap { position: relative; float: right; width: 240px; max-width: 40%; margin: 0 0 4px 12px; 
	border: 1px solid var(--line);
}

.qChapterPic { cursor: zoom-in; display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-thumbnail); 
}

.qChapterWrap::after {
	content: "Tap to view chapter image";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	-webkit-backdrop-filter: blur(18px);
	backdrop-filter: blur(18px);
	display: flex;
	align-items: center;
	align-items: safe center;
	justify-content: center;
	justify-content: safe center;
	box-sizing: border-box;
	padding: 0 8px;
	text-align: center;
	white-space: normal;
	overflow: hidden;
	font-size: 92%;
	font-weight: normal;
	color: var(--fg);
	text-shadow: 0 0 1px #000, 0 0 2px #000, 0 0 2px #000, 0 0 3px #000, 0 0 2px #000;
}
@media (hover: hover) and (pointer: fine) {
	html .qChapterWrap::after {
		content: "Click to view chapter image";
	}
}
.qRequest:has(.qChapterWrap) { display: flow-root; }

/* the calendar's navigation, as the Quests list's: the paths' faces and (a lord's) the chapter before / the chapter / the one after (app.js renderModalCalendar); the header's tabs are hidden */
#cmp.modalWy #cmn .mTabList { display: none; }
.calNavBox { max-width: 560px; margin: 0 auto 8px; }
.calNavBox .qNav { padding: 4px 4px 6px; }
.calLord { margin: 0 0 10px; }
.calLordHead { display: flex; align-items: center; gap: 8px; margin: 14px 2px 0; font-family: "Nocturne", serif; font-size: 22px; font-weight: normal; }
.calLordFace { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.calRun { margin: 10px 2px 3px; font-size: 13px; color: var(--mut); }
.qUnlock { margin: 0 0 3px; }
.qUnlock .qPath { white-space: nowrap; margin-right: 0; }
.qUnlock .qPath .qFace { margin: 0; margin-left: 3px; }
/* an event that links something (a quest, a character) is an <a> itself (app.js calendarDay): the pill is the link */
a.calLine { cursor: pointer; text-decoration: none; text-shadow: none; }
a.calLine:hover { background: color-mix(in srgb, currentColor 20%, transparent); border-color: color-mix(in srgb, currentColor 60%, transparent); }
.calLine small { white-space: nowrap; } /* (a time stays on the line of the word before it: its space is a no-break one, app.js calendarDay) */
.calName { min-width: 0; } /* (a linked line's icon and name) */

/* the inside of a place (map.js hiOpen): over the world map, its own pan / zoom; the facility icons keep one size at any zoom (--s is 1 / the zoom) */
#lmi { position: absolute; inset: 0; z-index: 3; overflow: hidden; background: var(--surface-control, #1b1d22); cursor: grab; touch-action: none; user-select: none; }
#lmi[hidden] { display: none; }
#lmi.drag { cursor: grabbing; }
.lmiW { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.lmiPic { display: block; max-width: none; pointer-events: none; }
.lmiIc { position: absolute; width: 0; height: 0; }
.lmiIc img { position: absolute; left: 0; top: 0; width: 34px; height: 34px; transform: translate(-50%, -50%) scale(var(--s, 1)); }
.lmiIc::after {
	content: attr(data-t);
	position: absolute;
	left: 0; top: 0; opacity: 0;
	transform: translate(-50%, calc( 14px * var(--s, 1))) scale(var(--s, 1)); transform-origin: 50% 0;
	padding: 1px 6px;
    background: #0e232bd1;
    border: 1px solid var(--line);

	font-size: 12px;
	white-space: nowrap;
	pointer-events: none;
}

.lmiIc:hover::after {
	opacity: 1;
}
.lmHubBtn { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; padding: 4px 12px; position: relative; overflow: hidden; }
/* (its lead: a slice of the place's picture (as .lmLocImg) at its start, the button's whole height, fading into the button) */
#lmd .pk.lmHubBtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

#lmd .pk.lmHubBtn.on {
    position: sticky;
    top: -4px;
    z-index: 1;
}
.lmHubBtn .lmHubLead { 
	flex: none;
	align-self: stretch;
	width: 4em;
	margin: -4px 0 -4px -6px;
	background-size: 333.333%; background-position: center; background-repeat: no-repeat;
	/* (its edge: the location picture's painted-edge mask (.lmShot's, locationMaskAlpha), square, 3 times the button's height and against its right side, so only the mask's
	   right edge falls on it; the other edges are out of it) */
	-webkit-mask: url(../images/map/ui/locationMaskAlpha.webp) right center / auto 300% no-repeat; mask: url(../images/map/ui/locationMaskAlpha.webp) right center / auto 300% no-repeat; pointer-events: none; }
.lmiNpc { position: absolute; width: 0; height: 0; }
.lmiNpc img {
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    background: #333;
    box-shadow: 0 1px 2px black;
    transform: translate(-50%, -50%) scale(var(--s, 1));
}
.lmiNpc img:hover {
    z-index: 3;
}
.lmiNpc::after { content: attr(data-t); position: absolute; left: 0; top: 0; opacity: 0; transform: translate(-50%, calc( 14px * var(--s, 1))) scale(var(--s, 1)); transform-origin: 50% 0; padding: 1px 6px;
    background: #0e232bd1;
    border: 1px solid var(--line);
	font-size: 12px; white-space: nowrap; pointer-events: none; }
.lmiNpc:hover::after {
	opacity: 1;
}
.lmiNpc:has(img)::after {
	display: none;
}
/* labels under every icon and face, the hovered one's over all of them (the spans make no stacking context of their own: they all stack in .lmiW) */
.lmiIc img, .lmiNpc img, .lmiNpc:not(:has(img))::before { z-index: 2; }
.lmiIc::after, .lmiNpc::after { z-index: 1; }
.lmiIc:hover::after, .lmiNpc:hover::after { z-index: 3; }
.lmiNpc:not(:has(img))::before { content: ""; position: absolute; left: 0; top: 0; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; background: #6a7fc8; transform: translate(-50%, -50%) scale(var(--s, 1)); } /* (a character with no face picture: a dot) */
/* a dungeon area's markers (m.marks): breakables and ores (small, named on hover), chests (their items under them), entrances and exits (a label under each). Like the icons they keep their size at every zoom (--s) */
.lmiMk { position: absolute; width: 0; height: 0; }
.lmiMk > img { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%) scale(var(--s, 1)); z-index: 2; }
.lmiBrk > img, .lmiOre > img { width: 30px; height: 30px; } /* (IconMk_*: the game's 28px white silhouette at 1:1 on a dark disc with a coloured ring and a hairline shadow, baked in; 3px margin for the shadow) */
.lmiCh > img { width: 38px; height: 38px; z-index: 3; }
.lmiHov .lmiTip { transform: translate(-50%, calc(15px * var(--s, 1))) scale(var(--s, 1)); display: none; } /* (a breakable's / ore's drops: under the marker on hover, as a chest's items are) */
.lmiHov:hover .lmiTip { display: flex; z-index: 5; }
.lmiTip > span { display: flex; justify-content: space-between; align-items: center; gap: 10px; } /* (a row: the icon and name in .lmiTipN, the chance after it) */
.lmiTip small { font-size: inherit; }
.lmiMk:hover > img { z-index: 4; }
/* a marker that is a link (<a class="lmiGo">): a box with the icon followed by the text, centred on the spot (it keeps its size at every zoom, --s) */
.lmiMk.lmiGo { 
	display: flex; align-items: center; gap: 4px; width: auto; height: auto; box-sizing: border-box; padding: 3px 4px 3px 3px; 
	transform: translate(-50%, -50%) scale(var(--s, 1)); transform-origin: 50% 50%; white-space: nowrap; z-index: 3; cursor: pointer; text-decoration: none;
	color: var(--text);
	font-size: 14px;
	border: 2px solid #53593da6; 
	background-color: #0e232bd1;
    box-shadow: 1px 1px 2px black }
.lmiMk.lmiGo > img { position: static; transform: none; width: 22px; height: 22px; flex: none; filter: none; }
.lmiGo > .lmiLbl { position: static; transform: none; }
.lmiMk.lmiGo:hover, .lmiMk.lmiGo:focus-visible { z-index: 5; outline: none; }
.lmiGo { -webkit-user-drag: none; -webkit-touch-callout: none; } /* (a hub link: the map's drag starts on it, map.js hiBuild; not the browser's link drag) */
.lmiChL { 
	color: var(--lighter);
	position: absolute; 
	left: 0; 
	top: -3px; 
	transform: translate(-50%, calc(21px * var(--s, 1))) scale(var(--s, 1)); 
	transform-origin: 50% 0; 
	display: flex; 
	flex-direction: column; 
	gap: 1px;
    padding: 3px 4px;
	background: #0e232bd1;
	color: #fff;
	font-size: 12px;
	line-height: 1.3;
	white-space: nowrap;
	pointer-events: none;
	z-index: 1;
	border: 1px solid var(--line);
}
.lmiChL {
	line-height: 16px;
	color: var(--fg);
}
.lmiChL .si { height: 16px; width: 16px; margin-right: 4px; vertical-align: top; }
.lmiCh:hover .lmiChL { z-index: 5; }
.lmiDoor > img { width: 34px; height: 34px; filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8)); }

.lmiCh .lmiChL {
	top: -6px;
}

.lmiMk.lmiQuest {
	position:absolute;
	width:0;
	height:0;
	z-index:7;
	pointer-events:none;
}

.lmiChL>span {
    display: flex;
    justify-content: space-between;
    align-items: center;
	gap: 0 6px;
	padding: 1px 0;
}

.lmiMk.lmiQuest span {
	position:absolute;
	left:0;
	top:0;
	transform:translate(-50%,-50%);
	border-radius:50%;
    filter: drop-shadow(1px 1px 1px black);
}

.lmiMk.lmiQuest img {
	position:absolute;
	left:0;
	bottom:calc(10px * var(--s));
	width:calc(36px * var(--s));
	height:auto;
	transform:translate(-50%, -100%);
}
.lmiMk.lmiQuest::before {
	display: none;
}


#idp .qStepMaps {
	gap: 0;
	margin-left: -32px;
	margin-right: -10px;
	justify-content: center;
}

@media screen and (max-width: 1100px) and (orientation: portrait) {
	.qStepMaps {
    	gap: 0;
		margin-left: -32px;
		margin-right: -10px;
        justify-content: center;
	}
}

@media screen and (max-width: 1500px) {
	.qPane .qStepMaps {
    	gap: 0;
		margin-left: -32px;
		margin-right: -10px;
        justify-content: center;
	}
}

/* ---- battle maps (?battle=<slug>, app.js buildBattleDetail): the map from above with its units on the left, the unit groups with their triggers on the right ---- */
/* a random battle map's enemy groups (buildBattleDetail groupRows): the battle, its enemies, its places */
.bmVariant { margin: 0 0 10px; }
.bmVariant .idText { margin: 0 0 2px; }
.bmVarHead { display: block; margin: 8px 0 4px; }
#idp.battlePopup .mb { width: min(1180px, 100%); }
/* a paired ending (app.js buildEndingDetail), as the game's ending screen (Layout Ending: AfterEpisode): on the screen's panel (Ending_AfterEpisode_Bg, end-bg), the two
   characters' cards on the left (the recruitment page's: the game's ending card, .rcCard), the text on the right between two rules (Common_Border01, end-rule, ending in
   the two diamonds, Common_HelpDetail_DecoTitle, end-deco: the top one's on its right, the bottom one's mirrored on its left), each line on its text line (AfterEpisode_Border, end-line) */
#idp.endingPopup .mb { width: min(1100px, 100%); background: #081619; }
/* (the window: the ending screen's panel itself, its own frame on its edges (end-bg), in place of the other popups' info window; nine pieces: the corners 80 px at 1:1 (their
   frame and specks unstretched), the edges and the middle stretched to the window) */
#idp.endingPopup .mb::before { inset: 0; background: none; border-image: url("../images/ui/end-bg.webp") 80 fill / 80px stretch; }
.endHeart { font-size: 26px; line-height: 1; }
.endWrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 14px 28px 26px; }
.endCards { display: flex; flex-direction: column; gap: 14px; }
.endCard { min-height: 11.5em; }
.endCard .rcBody { justify-content: center; height: 100%; padding-top: 18px; }
.endCard .rcTitle > a { font-size: 1.6em; }
.endCard .rcTitle > span { font-size: 1.05em; }
.endText { min-width: 0; }
.endRule { height: 30px; margin: 0 -10px; background: url("../images/ui/end-rule.webp") right center / auto 100% no-repeat; } /* (its diamonds on the right, at their own size: a narrow screen cuts the line's start, not them) */
.endRuleEnd { transform: scaleX(-1); } /* (the bottom one: the diamonds on the left) */
.endText p { margin: 4px 0 8px; padding: 0 12px; font-family: "Nocturne", serif; font-size: 16.5px; line-height: 2.25em; color: #f8f0dc; background: url("../images/ui/end-line.webp") 0 0 / 100% 2.25em repeat-y; }
/* (a short landscape screen (a phone on its side): the popup scrolls, the text taller than the window; the cards at the top, and kept in view while the text scrolls) */
@media screen and (orientation: landscape) and (max-height: 700px) and (min-width: 701px) {
	.endWrap { align-items: start; padding-top: 8px; }
	.endCards { position: sticky; top: 18px; z-index: 1; gap: 8px; }
	.endCard { min-height: 0; height: min(7em, calc((100vh - 130px) / 2)); } /* (both cards in view: each half the scrolling area, at most 7em) */
	.endCard .rcBody { padding-top: 8px; }
	.endCard .rcTitle > a { font-size: 1.3em; }
	.endCard .rcTitle > span { font-size: .9em; }
}
@media screen and (max-width: 700px) {
	.endWrap { grid-template-columns: 1fr; padding: 14px 12px; gap: 14px; }
	.endCards { gap: 8px; }
	.endCard { min-height: 6.5em; }
	.endCard .rcBody { padding-top: 10px; }
	.endCard .rcTitle > a { font-size: 1.3em; }
	.endCard .rcTitle > span { font-size: .9em; }
	.endText p { font-size: 15px; }
}
/* the support table's View (a pair's paired ending) */
.endView {
    padding: 3px 8px;
    vertical-align: middle;
    margin-left: 0;
    font-size: 0.92em;
}
.bmBody { display: flex; gap: 12px; align-items: flex-start; }
.bmBody .pk {
    padding: 6px 8px;
}
/* (the map at its own size: a cell 32 x 32 px, the picture's own pixels (app.js sets its width); a small map's box takes half the width, the map scaled up in it) */
.bmLeft { flex: 0 1 auto; min-width: 50%; max-width: 100%; }
/* (the map's box: as wide as the column, the map's shape, never taller than the screen leaves; the map moved and scaled in it, app.js battleCamInit) */
.bmView { position: relative; width: 100%; max-height: max(280px, calc(100dvh - 220px)); overflow: hidden; background: var(--surface-quest-hub); border: 1px solid var(--border-quest-panel); box-sizing: border-box; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.bmView.drag, .bmView.drag .bmMap { cursor: grabbing; }
.bmView > .bmMap { position: absolute; left: 0; top: 0; transform-origin: 0 0; border: 0; }
.bmView img { -webkit-user-drag: none; }
.bmZoom { position: absolute; right: 6px; top: 6px; display: flex; flex-direction: column; gap: 4px; z-index: 5; }
.bmBody .bmZoom .pk { width: 32px; height: 32px; padding: 0; text-align: center; font-size: 18px; line-height: 1; border: 2px solid var(--boxLine); background-color: var(--surface-control); }
.bmSide { flex: 1 1 0; min-width: 300px; }
@media (max-width: 720px) { .bmBody { flex-direction: column; align-items: stretch; } .bmSide { min-width: 0; } }
/* (the side under the map: the map leaves at least 200px of the popup below it, where a swipe still scrolls the popup (one on the map moves the map). The popup's
   height (#idp .mb: 90vh at most, 12px in from the screen) less its title (about 75px), the map's 10px from it and the 200px) */
@media (max-width: 720px) { .bmView { max-height: max(120px, calc(min(90dvh, 100dvh - 24px) - 285px)); } }
/* (side by side: the popup does not scroll; the side (groups, loot) scrolls in its own column, the map stays in view) */
@media (min-width: 721px) {
	#idp.battlePopup #idw { overflow: hidden; }
	#idp.battlePopup #idc { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 10px; }
	#idp.battlePopup #idc > * { flex: none; }
	#idp.battlePopup #idc > .bmBody { flex: 1 1 auto; min-height: 0; align-items: stretch; }
	#idp.battlePopup .bmLeft { align-self: flex-start; }
	#idp.battlePopup .bmSide { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
}
.bmMap { position: relative; box-sizing: content-box; flex: none; container-type: inline-size; overflow: hidden; background: var(--surface-quest-hub); border: 1px solid var(--border-quest-panel); }
.bmPic { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.bmU { position: absolute; display: block; box-sizing: border-box; }
.bmU[hidden] { display: none; }
.bmU img {
	image-rendering: pixelated;
	position: absolute;
	left: 0;
	top: 0;
	width: 100%; height: 100%; object-fit: contain;
}

/* the unit's pictures (its class icon, and a named unit's face badge over it, app.js battleUnitPic): one outline round their shape together, not one each */
.bmPics {
	position: absolute;
	inset: 0;
	filter: drop-shadow(1px 0 0 #000) drop-shadow(-1px 0 0 #000) drop-shadow(0 1px 0 #000) drop-shadow(0 -1px 0 #000);
}

.bmU:not(:empty)::before {
    content: "";
    display: block;
    border-radius: 70%;
    background: rgba(0, 0, 0, 0.5);
    height: 32%;
    width: 68%;
    left: 16%;
    top: 67%;
    position: absolute;
    z-index: 0;
}

/* a mounted unit (its class's type in data.json: app.js battleMountClass): its icon's feet are lower, nudged up onto the shadow */
.bmU.bmCavalry .bmIc {
	margin-top: -6%;
}
.bmU.bmCavalry .bmFaceBadge {
	bottom: 59%;
}

.bmU.bmCavalry::before {
    width: 80%;
    left: 10%;
}

.bmU.bmFlying .bmIc {
	margin-top: -12%;
}

.bmU.bmFlying .bmFaceBadge {
	bottom: 65%;
}


.bmU img.bmFaceBadge { 
	left: 25%; 
	right: auto; 
	top: auto; 
	bottom: 53%; 
	width: 50%; 
	height: 50%; 
	border-top-right-radius: 25%;
	border-top-left-radius: 25%;
	z-index: 1; 
	box-sizing: border-box; 
	object-fit: cover; 
	image-rendering: auto; } /* (a named unit's face over its class icon: half the mark, centred, its bottom at half its height, app.js battleUnitPic) */
.bmU img.bmFace { left: 6%; top: 6%; width: 88%; height: 88%; box-sizing: border-box; object-fit: cover; border-radius: 50%; border: 2px solid currentColor; background: rgba(0, 0, 0, .45); }
.bmU.bm-blue, .bmInfoPic.bm-blue { color: #3b78ff; }
.bmU.bm-red, .bmInfoPic.bm-red { color: #e04545; }
.bmU.bm-green, .bmInfoPic.bm-green { color: #3cb04a; }
.bmU.bm-yellow, .bmInfoPic.bm-yellow { color: #e0bf30; }
.bmU.bmSel { outline: 2px solid #fff; outline-offset: -1px; background: rgba(255, 255, 255, .25); z-index: 2; }
.bmGrid { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; background-image: linear-gradient(to right, rgba(0, 0, 0, .35) 1px, transparent 1px), linear-gradient(to bottom, rgba(0, 0, 0, .35) 1px, transparent 1px); }
.bmTiles { position: absolute; left: 0; top: 0; width: 100%; height: 100%; shape-rendering: crispEdges; }
.bmTiles rect { opacity: .42; } /* (over the picture in grey: app.js battleTilesSvg) */
.bmTiles clipPath rect { opacity: 1; }
.bmKey { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: .88em; }
.bmKeyIt { display: inline-flex; align-items: center; gap: 5px; }
.bmKeyIt i { width: 12px; height: 12px; flex: 0 0 auto; border: 1px solid rgba(0, 0, 0, .4); opacity: .8; }
.bmKeyIt small { opacity: .75; }
.bmInfo { margin-top: 8px; padding: 8px; border: 1px solid var(--border-quest-panel); background: var(--surface-quest-hub); }
.bmHint { margin: 0; opacity: .8; }
.bmInfoHead { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.bmInfoHead > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bmInfoPic { width: 48px; height: 48px; flex: 0 0 auto; object-fit: contain; image-rendering: pixelated; } /* (the game's class sprites: hard pixels when enlarged) */
.bmInfoPic.bmFace { image-rendering: auto; } /* (a face picture: smooth) */
.bmInfoPic.bmFace { box-sizing: border-box; object-fit: cover; border-radius: 50%; border: 2px solid currentColor; }
img.si.bmFace { border-radius: 50%; object-fit: cover; } /* (a face picture (96x64) at icon size, anywhere: a chip, the "dropped by" link of a battle's drops) */
.bmSlot { border: 2px solid rgba(90, 150, 255, .95); background: rgba(90, 150, 255, .3); }
.bmU.bmLate::after { content: ''; position: absolute; inset: 2%; border: 2px dashed rgba(255, 255, 255, .9); border-radius: 50%; pointer-events: none; }
.bmArea { position: absolute; box-sizing: border-box; border: 2px dashed rgba(255, 225, 110, .95); background: rgba(255, 225, 110, .08); pointer-events: none; }
.bmArea b { position: absolute; left: 3px; top: 1px; font-size: max(11px, 2.4cqw); line-height: 1; color: #ffe16e; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.bmNote { margin: 6px 0 0; opacity: .8; }
.bmDiff { margin-bottom: 8px; }
/* (the army level, after the difficulty) */
.bmArmy { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; white-space: nowrap; }
.bmArmy select { -webkit-appearance: none; appearance: none; width: auto; min-width: 36px; height: 31px; padding: 2px; color: inherit; background: #0c2228; border: 1px solid var(--line); border-radius: 0; text-align: center; font: inherit;
margin-right: 1px; }
.bmRow { padding: 7px 0; border-bottom: 1px solid var(--border-quest-panel); }
.bmRow:last-child { border-bottom: 0; }
.bmSw { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.bmSw input { margin: 0; }
.bmDot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; }
.bmDot.bm-blue { background: #3b78ff; border-color: #3b78ff; }
.bmDot.bm-red { background: #e04545; border-color: #e04545; }
.bmDot.bm-green { background: #3cb04a; border-color: #3cb04a; }
.bmDot.bm-yellow { background: #e0bf30; border-color: #e0bf30; }
.bmDot.bmLate { background: transparent; border-width: 2px; border-style: dashed; }
.bmWhen { margin: 3px 0 4px 26px; font-size: .88em; opacity: .85; }
.bmRow .dropsContainer { margin-left: 26px; }
.bmSlotChip { opacity: .8; }

/* a travelling merchant's waypoint on the map (map.js renderMarkers: vendors.json nodes, shown while the merchant's search is on) */
.lmWp { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #f6e6b8; border: 3px solid #c9761c; box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), 0 0 10px 3px rgba(255, 200, 90, .8); z-index: 3; pointer-events: auto; }

/* loot on a battle map (app.js buildBattleDetail): a chest / an item on the ground on its cell, the mark on a unit that drops something, the lists */
.bmLoot { position: absolute; box-sizing: border-box; }
.bmLoot img { position: absolute; left: 12%; top: 12%; width: 76%; height: 76%; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .8)); }
.bmGround img { left: 22%; top: 22%; width: 56%; height: 56%; }
/* a unit carrying a drop: the game's on-map tag (Layout/Battle.arc OnMap_IconItemDrop, 64 x 32) at its bottom right; a boss the battle needs defeated: the game's
   leader medal (Layout/Textures/Icon_System.arc OnMap_IconLeader, 42 x 56) at its top left */
.bmDropMk { position: absolute; right: -10%; bottom: -6%; width: 62%; aspect-ratio: 2; background: url("../images/ui/onmap-drop.webp") center / contain no-repeat; pointer-events: none; z-index: 1; }
.bmBossMk {
    position: absolute;
    left: -13%;
    top: -13%;
    width: 45%;
    aspect-ratio: 42 / 56;
    background: url(../images/ui/onmap-leader.webp) center / contain no-repeat;
    pointer-events: none;
    z-index: 1;
}
.bmDrops { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 6px 0; }
.bmDropIc { margin-right: 4px; }
/* (the chests and drops: first in the side column, in a gold frame) */
.bmRow.bmLootRow { border: 1px solid var(--accent-quest); padding: 7px 8px; margin: 4px 0 8px; }
.bmLootRow > b { display: flex; align-items: center; }
.bmLootList { margin: 6px 0 0; }

.bmLootList .idChip { margin-right: 1px;}
.bmLootList li { margin: 3px 0; }
.bmLootList a[data-bmdrop] { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; } /* (the unit that drops it: its icon, then its name) */
.bmLootList a[data-bmdrop] > .si, .bmLootList a[data-bmdrop] > img { flex: none; }
/* the reinforcements of a battle map (app.js buildBattleDetail): one row of buttons, each a switch (its dot, its trigger, its count) over its units; lit while shown */
.bmReList { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bmRe { flex: 1 1 190px; min-width: 0; box-sizing: border-box; padding: 5px 8px; border: 1px solid var(--border-quest-panel); opacity: .7; }
.bmRe.on { opacity: 1; border-color: var(--glow-marker-on); background: rgba(224, 193, 143, .08); }
.bmReSw { align-items: flex-start; gap: 6px; font-size: .88em; line-height: 1.3; }
.bmReSw input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.bmReSw:focus-within { outline: 1px solid var(--glow-marker-on); outline-offset: 2px; }
.bmReSw .bmDot { margin-top: 2px; }
.bmRow .bmRe .dropsContainer { margin: 4px 0 0 18px; }

/* a guest on a battle map (battles.json colour teal: the player controls it, it is not theirs), the path buttons */
.bmU.bm-teal, .bmInfoPic.bm-teal { color: #19b8ad; }
.bmDot.bm-teal { background: #19b8ad; border-color: #19b8ad; }
.bmPaths .qFace { margin-right: 4px; }
.bmPaths a small { margin-left: 5px; } /* (a random battle's regions: their levels) */

/* a quest's Reward box: what its battles give (app.js questBattleLootHtml), under the quest's own rewards */
.qLootHead { margin: 8px 0 2px; opacity: .85; }
.qLootHead:first-child { margin-top: 0; }
.qRewLoot .qRewName small, .qRew .qRewName small { opacity: .8; margin-left: 4px; }

/* a posthouse's carriage routes on the map (map.js renderMarkers, carriage.json): the game's route look from its DrawerSettings.prop: the dark edge (FUCHI_RouteColor,
   black at 0.61) and the line in DESTINATION_RouteColor (0.902, 0.784, 0.416); no blink (the user's wish). The widths are screen pixels (the lines keep them at every zoom) */
.lmLines path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.lmLines:has(path) { filter: none; } /* (the routes have their own dark edge) */
.lmLines .lmWayEdge { stroke: rgba(0, 0, 0, .61); stroke-width: 6.5; }
.lmLines .lmWayLine { stroke: rgb(230, 200, 106); stroke-width: 3.4; }

.qMissBar {
    flex: none;
    display: flex;
    align-items: stretch;
    gap: 6px;
    padding: 5px 5px 10px;
    height: 34px;
}
@media screen and (orientation: portrait), screen and (max-width: 800px) {
	.qMissBar { margin-right: 46px; padding-right: 0; } /* (the list alone: the close button, 60px (.mh --mhLine), is at the end of this row) */
	body #cmp.modalWx #cmx, body #cmp.modalWy #cmx {
		top: 8px;
		right: 8px;
	}
}
.qMissBar .qSearchSlot { display: flex; }
.qMissBar .pk.qMissOnly { min-height: 0; box-sizing: border-box; }
/* (the list's search box beside the switch: renderModal moves the modal's search (#cms) into .qSearchSlot; it searches the rows: their names, rewards, givers and places) */
.qMissBar .qSearchSlot { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; border-bottom: 0; }
.qMissBar .qMissOnly { flex: none; color: var(--text); text-decoration: none; } /* (a link in the list: the header switch's plain text, not a link's colour and underline) */
.qMissOnly { display: inline-flex; align-items: center; gap: 4px; } /* (the max forge level switch's look: the box and its check, style.css #cmn .mxToggle) */

/* the Quests list's chapter title as a button (app.js renderModalQuests nav): it opens the list of every chapter of the tab, a click on one goes there (data-qchap) */
.qNavPick { position: relative; }
.qNavPick > summary { list-style: none; cursor: pointer; padding: 2px 10px; }
.qNavPick > summary::-webkit-details-marker { display: none; }
.qNavPick > summary > span::after { content: " \25BE"; } /* (on the label: the summary's own ::before / ::after are the pill's halves) */
/* the chapter drop-down in the tab button's pill (as the selected tab's); the previous / next chapters beside it are text links */
.qNavPick > summary.qNavCur { --tabH: 34px; --capW: calc(var(--tabH) * 20 / 36); position: relative; z-index: 0; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: var(--tabH); padding: 0 var(--capW); border: 2px solid transparent; }
.qNavPick > summary.qNavCur::before, .qNavPick > summary.qNavCur::after { content: ""; position: absolute; top: -2px; bottom: -2px; left: -2px; right: calc(50% - 1px); background: url(../images/ui/PageTabTxt_KeyHelpFrm_Half.webp) left center / auto 100% no-repeat; z-index: -1; pointer-events: none; }
.qNavPick > summary.qNavCur::after { left: calc(50% - 1px); right: -2px; transform: scaleX(-1); }
.qNavRow .qNavBtn.qPrev, .qNavRow .qNavBtn.qNext { --tabH: auto; min-height: 0; padding: 4px; border: 0;}
.qNavRow .qNavBtn.qPrev::before, .qNavRow .qNavBtn.qPrev::after, .qNavRow .qNavBtn.qNext::before, .qNavRow .qNavBtn.qNext::after { display: none; }
.qNavRow a.qNavBtn.qPrev:hover, .qNavRow a.qNavBtn.qNext:hover { text-decoration: underline; }
.qNavRow .qNavBtn.qPrev { justify-self: end; } /* (the previous / next links right beside the chapter's drop-down, not at the sides) */
.qNavRow .qNavBtn.qNext { justify-self: start; }
.qNavPick + .qNavTitle { 
    margin-top: -4px;
    z-index: 1;
	pointer-events: none;
}
.qNavPick > summary:hover, .qNavPick[open] > summary { text-shadow: var(--glow); }
.qNavMenu { position: absolute; z-index: 30; left: 50%; transform: translateX(-50%); top: calc(100% + 4px); min-width: 200px; max-height: min(420px, calc(100dvh - 160px - env(safe-area-inset-bottom, 0px))); /* (from its place, under the search, the paths and the chapter, to the bottom of the screen) */ overflow-y: auto;
  display: flex; flex-direction: column; padding: 4px; background: var(--surface-modal); border: 1px solid var(--boxLine); box-shadow: 0 6px 18px rgba(0, 0, 0, .6); }
.qNavMenu .qNavBtn { --tabH: auto; min-height: 0; justify-content: flex-start; } /* (a chapter link of the list: chapLink gives it the navigation buttons' class, not their frame) */
.qNavMenu .qNavBtn::before, .qNavMenu .qNavBtn::after { display: none; }
.qNavMenu .qNavOpt { display: block; flex-shrink: 0; padding: 5px 10px; white-space: nowrap; text-decoration: none; color: inherit; } /* (flex-shrink 0: a long list scrolls, its links keep their text's height) */
.qNavMenu .qNavOpt:hover { background: rgba(255, 255, 255, .07); }
.qNavMenu .qNavOpt.on { font-weight: bold; }
/* the previous / next chapter buttons: their full name ("Part I: Chapter 3"), on small screens their short one ("Ch. 3") with the title between them on one line */
.qNavShort { display: none; }
@container (max-width: 620px) { /* (the same narrow sidebar as the rule above: the buttons' short names, all three on one row) */
	.qNavLong { display: none; }
	.qNavShort { display: inline; }
	.qNavRow { grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr); } /* (the two buttons' columns as wide as each other, at least their button: the title stays in the middle whatever the buttons say) */
	.qNavRow .qPrev { grid-column: 1; grid-row: 1; }
	.qNavRow .qNavMid { grid-column: 2; grid-row: 1; min-width: 0; }
	.qNavRow .qNext { grid-column: 3; grid-row: 1; }
	.qNavRow .qNavCur { font-size: 15px; white-space: nowrap; }
}
/* (the Calendar's navigation, which is not in a sidebar: the same short names on a phone's width) */
@media screen and (max-width: 620px) {
	.calNavBox .qNavLong { display: none; }
	.calNavBox .qNavShort { display: inline; }
	.calNavBox .qNavRow { grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr); } /* (the two buttons' columns as wide as each other, at least their button: the title stays in the middle whatever the buttons say) */
	.calNavBox .qNavRow .qPrev { grid-column: 1; grid-row: 1; }
	.calNavBox .qNavRow .qNavMid { grid-column: 2; grid-row: 1; min-width: 0; }
	.calNavBox .qNavRow .qNext { grid-column: 3; grid-row: 1; }
	.calNavBox .qNavRow .qNavCur { font-size: 15px; white-space: nowrap; }
}

/* a reward of skill Exp (app.js rewardNoteHtml): each skill's icon and its amount */
.qSkillExp { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; white-space: nowrap; }
.qSkillExp .si { margin: 0; }

/* a gate that can never be passed on this path (map.js renderMarkers .shut: its rn "Unusable"): the game's impassable sign (UI/Gmap UI_IconState_Impassable) on the pin's bottom right corner,
   scaled with the pin like its ::before */
.lmm.shut::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 100px;
	height: 100px;
	background: url("../images/map/state_impassable.png") center / contain no-repeat;
	transform: translate(-50%, -50%) scale(calc(var(--pinN, 26) * var(--k) * var(--sel) / 100)) translate(30px, 30px) scale(.5);
	pointer-events: none;
}

/* the map panel's Quests and Battles (map.js qbHtml): a details closed at first, its whole heading the switch; a quest's battles indented under it */
.lmQB > summary { list-style: none; cursor: pointer; }
.lmQB > summary::-webkit-details-marker { display: none; }
.lmQB > summary .calcTitle { 
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 6px; 
    align-items: center;
}

/* (the summary's arrow: right when closed, down when open) */
.lmQB > summary .calcTitle::before { content: "\25B8"; display: inline-block; font-size: 1.5em; line-height: .7; margin-right: -4px; transition: transform .15s; } /* (the gap after it: the title's column-gap less 4px) */
.lmQB[open] > summary .calcTitle::before { transform: rotate(90deg); }
.lmQB > summary:hover .calcTitle { text-shadow: var(--glow); }
.lmQBHint { 
	font-weight: normal;
	letter-spacing: normal;
} /* (srcK, the counters' text: not the title's small caps) */
.lmQB[open] .lmQBOpen, .lmQB:not([open]) .lmQBClose { display: none; }
.lmQB li.lmQBSub { padding-left: 22px; }

/* a text for the way the page is used (map.js qbHtml): "Click" with a mouse, "Tap" on a touch screen (no hover, or a coarse pointer) */
.byTouch { display: none; }
@media (hover: none), (pointer: coarse) {
	.byMouse { display: none; }
	.byTouch { display: inline; }
}


/* a quest's battle loot that can be missed (app.js questRewards, missableLootOf): the item with the missable marker after it */
.qMissLoot .qMissMk { margin-left: 2px; opacity: .85; }
.qRowRewItem.qMissLoot .qMissMk { width: 16px; height: 16px; } /* (a quest row's: small; the quest screen's reward list: .si's size) */

/* a battle map's selected tile (app.js: a click on the map, its tooltip in #tip): a light frame on the cell, over the units */
.bmCellSel { position: absolute; box-sizing: border-box; border: 2px solid #f5e6b8; box-shadow: 0 0 0 1px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(0, 0, 0, .5); background: rgba(245, 230, 184, .15); pointer-events: none; z-index: 4; }
.bmMap { cursor: pointer; }
#tip .bmTipBoss { color: #f0c060; }
/* (a long press on the battle map: no link callout / preview (iOS Safari); the context menu is stopped in app.js) */
.bmView, .bmView * { -webkit-touch-callout: none; } /* (no link menu when a unit is held) */
/* no blue tap flash on the maps (the battle map's click handler listens on the whole map: a tap flashed the whole map; on the world and hub maps the pins flashed): the tapped tile's selection and the opened location show instead */
.bmView, .bmView *, #lmv, #lmv *, #lmi, #lmi * { -webkit-tap-highlight-color: transparent; }
#tip.bmTipOnMap { pointer-events: none; } /* (a battle map's tooltip: clicks, drags, pinches and the wheel go through it to the map) */

/* a battle unit's details in its tile's tooltip (app.js battleTipHtml: battleUnitInfo, as the old panel under the map) */
#tip { max-width: min(calc(100vw - 16px), 620px); }
#tip .bmTipUnit .unitStatWrap { overflow-x: auto; }
#tip .bmTipUnit .bmInfoHead a { color: inherit; }
#tip .bmTipBoss { margin-top: 4px; }

/* the battle's groups as one table (app.js buildBattleDetail list): a row per group: its switch and side dot, when it comes (short; the whole condition as the
   cell's tooltip, the ⓘ when there is more), its units; a row whose units are hidden on the map is dimmed */
.bmTbl { width: 100%; border-collapse: collapse; font-size: .92em; }
.bmTbl th { text-align: left; font-weight: normal; font-size: .85em; opacity: .7; padding: 2px 6px 4px; border-bottom: 1px solid var(--border-quest-panel); }
.bmTbl td { padding: 4px 6px; border-bottom: 1px solid var(--border-quest-panel); vertical-align: top; }
/* (the last row keeps its bottom border, the first has one on top (no head row): the table closed above and below) */
.bmTbl tr:first-child td { border-top: 1px solid var(--border-quest-panel); }
.bmTbl .bmTr:not(.on) { opacity: .55; }
.bmTdSw { white-space: nowrap; }
.bmTdSw .bmSw { padding-top: 3px; }
.bmTdWhen { white-space: normal; cursor: help; padding-top: 6px !important; }
.bmMore { font-size: .85em; opacity: .7; }
/* the battle's objective (app.js buildBattleDetail: the quest window's Objective box, first in the side column): its victory and defeat lines */
.bmObjective { margin: 0 0 10px; }
.bmRule { margin: 2px 0; }
.bmRule small { opacity: .75; margin-right: 4px; }
.bmRuleWhen { margin: 8px 0 2px; padding-top: 6px; border-top: 1px solid var(--border-quest-panel); font-size: .9em; color: var(--accent-quest); } /* (a change during the battle: when it comes, over its new conditions) */
/* (a turn in the When column: the game's turn icon, an hourglass (app.js turnIc), then its number) */
.bmTurn { display: inline-flex; align-items: center; gap: 1px; white-space: nowrap; vertical-align: middle; }
.bmTurnIc { width: 1.15em; height: 1.15em; flex: none; }
.bmWhenTip { cursor: pointer; } /* (its condition in the tooltip on a click, app.js showBattleWhenTip) */
.bmWhenTip:hover .bmMore, .bmWhenTip:focus-visible .bmMore { opacity: 1; text-shadow: var(--glow); }
.bmTbl td, .bmTbl th { text-align: left; }
.bmTdUnits .bmUnitsIn { display: flex; flex-wrap: wrap; gap: 3px 12px; align-items: center; min-width: 0; } /* (the cell stays a table cell, its borders kept; its chips in this wrapper) */
.bmTdUnits .idChip { margin: 0; display: inline-flex; align-items: center; gap: 3px; min-width: 0; }
.bmTdUnits .idChip > a { display: inline-flex; align-items: center; gap: 3px; min-width: 0; }
.bmTdUnits .idChip > a > .si, .bmTdUnits .idChip > a > img { flex: none; }
.bmTdUnits .qCount { flex: none; }
.bmTbl { table-layout: fixed; }
/* (fixed layout takes the widths from the first row (no head row): the switch and When columns narrow, the units the rest) */
.bmTbl tr:first-child td:nth-child(1) { width: 38px; } /* (fixed layout: the first row sets the widths, the head row gone) */
.bmTbl tr:first-child td:nth-child(2) { width: 72px; }
.bmTdUnits { min-width: 0; word-break: normal; }

/* a battle unit's tooltip: its stats (a range over its levels) and its combat stats with its weapon, two narrow tables side by side (app.js battleUnitInfo) */
.bmTwoTbl { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 6px; }
.bmTwoTbl .bmVTbl { width: auto; min-width: 150px; flex: 1 1 150px; }
.bmVTbl thead th { text-align: left; white-space: nowrap; }
.bmVTbl thead th .si, .bmVTbl thead th img { width: 18px; height: 18px; vertical-align: -4px; margin-right: 4px; }
.bmVTbl tbody th { text-align: left; font-weight: normal; opacity: .85; }
.bmVTbl tbody td { text-align: right; white-space: nowrap; }

/* an enemy's panel in the game's style (app.js battleEnemyPanelHtml; Layout/Battle.arc Battle_UnitInfoSimple): the layout's 1080p coordinates times --s.
   #tip.euTip: the panel stands alone, no help window frame or arrow */
/* (the tile's terrain and chest under a unit's panel: a box of their own, the panel's width, the tooltip's solid colour) */
#tip .euTerrain { width: calc(430px * .62); box-sizing: border-box; margin-top: 4px; padding: 6px 10px; background: var(--surface-panel-dark); border: 1px solid var(--border-control); font-size: 14px; line-height: 1.35; }
#tip .euTerrain hr { margin: 6px 0; }
/* (several units on a tile: the note naming the one under it, a click again selects it: app.js battleTipHtml) */
#tip .bmStackNote { width: calc(430px * .62); box-sizing: border-box; margin: 4px 0 0; padding: 4px 10px; background: var(--surface-panel-dark); border: 1px solid var(--border-control); color: var(--text); line-height: 1.35; }
#tip.euTip { border-image: none; padding: 0; background: none; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)); max-width: none; }
/* (the help window's arrow too, pointing at the unit: its shape in the unit's side colour, --euSide (app.js), meeting the name bar) */
#tip.euTip::before { top: -10px; z-index: 2; background: var(--euSide, #6d0100); -webkit-mask: url("../images/ui/tip-arrow.webp") center / 100% 100% no-repeat; mask: url("../images/ui/tip-arrow.webp") center / 100% 100% no-repeat; }
#tip.euTip.up::before { top: auto; bottom: -21px; }
.euPanel { --s: .62; position: relative; width: calc(430px * var(--s)); height: calc(378px * var(--s)); overflow: hidden; color: #ffd9a5; line-height: 1; font-size: calc(26px * var(--s)); }
.euPanel > * { position: absolute; }
.euBg { left: 0; top: 0; width: calc(430px * var(--s)); height: calc(540px * var(--s)); background: url("../images/ui/eu-bg.webp") left top / 100% 100% no-repeat, url("../images/ui/eu-bg.webp") left top / 100% 100% no-repeat; } /* (twice: its fog's shape kept, its see-through middle darker over the page's text) */
.euFace { left: calc(170px * var(--s)); top: calc(120px * var(--s)); width: calc(280px * var(--s)); height: calc(280px * var(--s)); object-fit: contain; object-position: top;
  -webkit-mask: url("../images/ui/eu-face-mask.webp") center / 100% 100% no-repeat; mask: url("../images/ui/eu-face-mask.webp") center / 100% 100% no-repeat; }
.euNameBg { left: calc(-20px * var(--s)); top: calc(7px * var(--s)); width: calc(450px * var(--s)); height: calc(50px * var(--s)); background: url("../images/ui/eu-namebar-red.webp") left center / 100% 100% no-repeat; }
.euName { left: calc(30px * var(--s)); width: calc(324px * var(--s)); top: calc(32px * var(--s)); transform: translateY(-50%); text-align: center; font-size: calc(32px * var(--s)); color: #fff3dc !important; text-decoration: none; text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.euClass { left: calc(16px * var(--s)); top: calc(80px * var(--s)); transform: translateY(-50%); display: flex; align-items: center; gap: calc(8px * var(--s)); font-size: calc(26px * var(--s)); color: #f2e3c4; }
.euClassIc { width: calc(34px * var(--s)); height: calc(34px * var(--s)); object-fit: contain; image-rendering: pixelated; }
/* (a unit's types after its class: the game's IconFactor_Efficacy, 28 px at 1080p) */
.unitTypes { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; }
.unitTypes img { width: 18px; height: 18px; object-fit: contain; }
.euClass .unitTypes { gap: calc(2px * var(--s)); }
.euClass .unitTypes img { width: calc(28px * var(--s)); height: calc(28px * var(--s)); }
.idStats > .unitTypes { align-self: center; padding: 0 6px; }
.idStats > .unitTypes img { width: 22px; height: 22px; }
.unitPortrait ~ [data-sec], .unitPortrait ~ .idSec { clear: both; }
.unitPortrait { float: right; width: 140px; height: 140px; object-fit: contain; margin: 0 0 4px 12px; background-color: var(--surface-picture); -webkit-mask: url(../images/ui/IdPicMask.png) center / 100% 100% no-repeat; mask: url(../images/ui/IdPicMask.png) center / 100% 100% no-repeat; } /* (the picture mask of .idPic) */
.euClassIc.bmFace { border-radius: 50%; image-rendering: auto; }
.euDrop { left: calc(138px * var(--s)); top: calc(110px * var(--s)); width: calc(32px * var(--s)); height: calc(32px * var(--s)); }
.euLine { left: 0; top: calc(104px * var(--s)); width: calc(320px * var(--s)); height: calc(36px * var(--s)); background: url("../images/ui/eu-line-red.webp") left top / 100% 100% no-repeat; }
/* (the level on the gauge line, as the game's panel: Lv and, right-aligned, its number; a range from the label on, smaller) */
.euLvLabel { left: calc(234px * var(--s)); top: calc(118px * var(--s)); transform: translateY(-50%); font-size: calc(22px * var(--s)); color: #c9b58f; }
.euLv { left: calc(304px * var(--s)); top: calc(116px * var(--s)); transform: translate(-100%, -50%); font-size: calc(32px * var(--s)); white-space: nowrap; 
filter: drop-shadow(0px 0px 1px black) drop-shadow(1px 1px 0px black);}
.euLv { font-weight: 700; }
.euHpLabel { left: calc(29px * var(--s)); top: calc(133px * var(--s)); transform: translateY(-50%); color: #937a55; font-size: calc(26px * var(--s)); }
.euHp { left: calc(109px * var(--s)); top: calc(171px * var(--s)); transform: translate(-100%, -50%); /* (its right edge at 109: T_Num, right-aligned) */ font-size: calc(56px * var(--s)); text-shadow: 0 2px 3px #000; white-space: nowrap; }
.euHp.euHpRange { left: calc(29px * var(--s)); transform: translateY(-50%); font-size: calc(40px * var(--s)); }
.euHpSlash { left: calc(114px * var(--s)); top: calc(176px * var(--s)); transform: translateY(-50%); font-size: calc(36px * var(--s)); }
.euHpMax { left: calc(136px * var(--s)); top: calc(178px * var(--s)); transform: translateY(-50%); font-size: calc(36px * var(--s)); }
.euStats { left: 0; top: calc(195px * var(--s)); width: calc(200px * var(--s)); 
filter: drop-shadow(0px 0px 1px black) drop-shadow(1px 1px 0px black);
}
.euStat { position: relative; height: calc(32px * var(--s)); display: grid; grid-template-columns: calc(38px * var(--s)) calc(64px * var(--s)) auto; align-items: center; white-space: nowrap; } /* (icon, name, number: a range fits after the name) */
.euStatIc { width: calc(24px * var(--s)); height: calc(24px * var(--s)); margin-left: calc(12px * var(--s)); object-fit: contain; }
.euStatName { color: #f2e3c4; font-size: calc(24px * var(--s)); }
.euStatNum { font-size: calc(26px * var(--s)); }
.euEquip { left: calc(84px * var(--s)); top: calc((340px + 36px * var(--row)) * var(--s)); display: flex; align-items: center; gap: calc(8px * var(--s)); color: #ffd9a5; white-space: nowrap; }
.euEquip .si, .euEquip img { width: calc(30px * var(--s)); height: calc(30px * var(--s)); margin: 0; }
.euExtra {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: -28px;
    padding: 4px 7px;
    line-height: 1.25;
    background: rgba(8, 18, 20, .92);
    border-top: 1px solid rgba(255, 217, 165, .25);
    font-size: 14px;
    max-width: calc(430px * .62);
    box-sizing: border-box;
    z-index: 1;
    position: relative;
}
.euExtra .si { width: 14px; height: 14px; vertical-align: -3px; margin-right: 4px; }

/* the unit panel in its side's colours (the game's TypePlayer / TypeAlly / TypeGuest / TypeThird: Name_Bg and GaugeLv_Line) */
.euSide-blue .euNameBg { background-image: url("../images/ui/eu-namebar-blue.webp"); } .euSide-blue .euLine { background-image: url("../images/ui/eu-line-blue.webp"); }
.euSide-green .euNameBg { background-image: url("../images/ui/eu-namebar-green.webp"); } .euSide-green .euLine { background-image: url("../images/ui/eu-line-green.webp"); }
.euSide-teal .euNameBg { background-image: url("../images/ui/eu-namebar-teal.webp"); } .euSide-teal .euLine { background-image: url("../images/ui/eu-line-teal.webp"); }
.euSide-yellow .euNameBg { background-image: url("../images/ui/eu-namebar-yellow.webp"); } .euSide-yellow .euLine { background-image: url("../images/ui/eu-line-yellow.webp"); }
/* the game's detail mode (Info_Detail): the wider background (UnitInfoSimple_Moya_Detail, 537 px), the second column of stats 144 px right (N_InfoDetail_Status),
   the face at (410, 250) at 0.9 */
.euPanel.euDetail { width: calc(460px * var(--s)); } /* (narrower than the game's 537: the two columns and the face's left part) */
.euDetail .euBg { width: calc(460px * var(--s)); background-image: url("../images/ui/eu-bg-detail.webp"), url("../images/ui/eu-bg-detail.webp"); }
.euDetail .euFace { left: calc(250px * var(--s)); top: calc(124px * var(--s)); width: calc(252px * var(--s)); height: calc(252px * var(--s)); }
.euDetail .euStats { width: calc(205px * var(--s)); }
.euStats.euStats2 { left: calc(160px * var(--s)); } /* (the detail mode's two columns side by side, the face behind the second's right) */
.euDetail ~ .euExtra, .euDetail + .euExtra { max-width: calc(460px * .62); }
/* under the panel: the old tooltip's information (the base stats, the items carried, the level notes) and the mode switch */
.euBase { display: grid; grid-template-columns: repeat(3, auto); gap: 1px 10px; justify-content: start; }
.euBase span { display: flex; gap: 4px; align-items: baseline; white-space: nowrap; }
.euBase small { opacity: .7; }
/* a number its battalion or mount raises: the game's yellow with ▲ (the unit panel, its base stats, the tables under the map) */
.euUp, .euBase .euUp, .bmVTbl td.euUp { color: #f5c542; }
.euUp::after { content: "▲"; font-size: .6em; vertical-align: .55em; margin-left: 1px; }
.euBase .euUp small { color: inherit; }
.euPlace .si, .euPlace img { width: 14px; height: 14px; vertical-align: -3px; margin: 0 3px 0 0; }
.euCarry .si, .euCarry img { width: 14px; height: 14px; vertical-align: -3px; margin: 0 3px 0 0; }
.euNote { opacity: .75; }
.euMode { align-self: flex-end; font-size: 12px; color: #e8c88a; text-decoration: none; }
.euMode:hover { text-shadow: var(--glow); }

/* the unit panel's drops line: the game's drop icon (IconItemDrop, its gold frame), Drops, each item's icon and name */
.euDrops .euDropIc { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.euDrops .si, .euDrops img:not(.euDropIc) { width: 14px; height: 14px; vertical-align: -2px; margin: 0 3px 0 0; }

/* the equipped item in the unit panel's Carries list: the game's E mark (images/ui/IconEquip.png, app.js bcEqIcon) over its icon's top left corner */
.euCarry .bcEqIc { vertical-align: -3px; margin-right: 3px; }
.euCarry .bcEqIc > img:not(.bcEqMark), .euCarry .bcEqIc > .si { margin: 0; }
.euCarry .bcEqMark { width: 10px; height: 10px; left: -4px; top: -4px; }
.euCarry > b { margin-right: 6px; } /* (room for the E mark of the first item) */
/* the Carries row: larger; a drop's icon before the item (IconItemDrop, gold frame) */
.euCarry { font-size: 14px; line-height: 1.5; }
.euCarry .euItem { white-space: nowrap; }
.euCarry .euDropIc { width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; }
.euCarry .si, .euCarry img:not(.bcEqMark):not(.euDropIc) { width: 16px; height: 16px; }
/* a unit's extra health bars (the game's HP stock: Battle_UnitInfoSimple L_HPStock, part Common_HPStock): rubies (IconHPStock, 32 px at 0.8) right of HP, centres at 77 / 100 / 123, 133 */
.euStock { left: calc(64px * var(--s)); top: calc(120px * var(--s)); display: flex; gap: calc(3px * var(--s)); }
.euStock img { width: calc(25.6px * var(--s)); height: calc(25.6px * var(--s)); }

/* .gBtn: the game's menu item as a plain button (Create a build, Simple / Advanced mode, the Part I / Part III buttons of the liked gifts and the profile, a class's
   level buttons): the card tabs' unselected look (Common_Choice_WdwMenuItem_Default) with its ends cut at the frame (tab-l-edge / tab-r-edge: no transparent
   fringe, the frame at the button's edges); selected (.on): the open tab's look, out past its edges to line up (.on::after). Its height is fixed (a line, 4px padding,
   the 1px border) so the middle piece can stop half way into each end */
.pk.gBtn.gBtn { /* (doubled: over .pk.bcCreate:hover's background) */
	--gH: calc(1lh + 10px);
	border: 1px solid transparent;
	margin: 0;
	--bL: url("../images/ui/tab-edge-l.webp"); --bR: url("../images/ui/tab-edge-r.webp"); --bM: url("../images/ui/tab-edge-m.webp"); /* (the ends cut at the frame: 88 of the picture's 534) */
	/* (the middle: a 32 px strip from the picture's centre (tab-edge-m), stretched over the gap: the whole 534 px picture squeezed into a narrow button's few pixels
	   looked faded in Chrome / Edge, which shrinks it with a copy blurred for its strongest squeeze (about 9x across) in both directions) */
	--bE: calc(var(--gH) * 88 / 92); --bK: 1;
    text-decoration: none;
	font-weight: bold;
}
.pk.gBtn::before { display: none; }
.pk.gBtn.on {
	border-color: transparent;
	background: none !important;
	position: relative;
	isolation: isolate; /* (its ::after behind the text, over nothing else) */
}
/* (the open look is drawn where the game draws it: its frame 12 / 92 of the height out past the unselected one's on each side, so out of the button) */
.pk.gBtn.on::after {
	content: "";
	position: absolute;
	inset: -1px calc(-1px - var(--gH) * 12 / 92);
	z-index: -1;
	--bL: url("../images/ui/tab-open-l.webp"); --bR: url("../images/ui/tab-open-r.webp"); --bM: url("../images/ui/tab-open-m.webp"); /* (the middle: a strip, as the unselected look's) */
	--bE: calc(var(--gH) * 100 / 92); --bK: 1;
	pointer-events: none;
}
.pk.gBtn:hover, .pk.gBtn:focus-visible { text-shadow: var(--glow); }
.pk.gBtn.gBtn:not(.on):is(:hover, :focus-visible) { --bL: url("../images/ui/tab-edge-hover-l.webp"); --bR: url("../images/ui/tab-edge-hover-r.webp"); --bM: url("../images/ui/tab-edge-hover-m.webp"); } /* (the hover look, as the card tabs'; its middle a strip, as above) */

/* the Compatibility list (app.js renderModalCompat) in the grid view of the smaller screens: each level a line, its name on the left of its faces; an empty one takes no room */
@media screen and (max-width: 1100px) {
	#cmc tr > td.compatCol { display: flex; align-items: center; gap: 8px; text-align: left; }
	#cmc tr > td.compatCol .tableSv { display: inline-block; flex: none; width: 9.5em; text-align: left; }
	#cmc tr > td.compatCol .lrs { flex: 1; justify-content: flex-start; }
	#cmc tr > td.compatCol:empty { display: none; }
}

/* the Calendar in the Quests list's window (app.js renderModalCalendar: .qSideCol.calWin; the modal's own frame and header gone as the Quests modal's: the #cmp.modalWy
   rules beside modalWx's): the faces and chapter buttons on top, clear of the close button, the days scrolling under them (.calScroll) */
.calWin { flex: 1; min-width: 0; }
.calWin .calNavBox { flex: none; width: 100%; max-width: 640px; padding: 0; box-sizing: border-box; margin: 0 auto; }
.calScroll { padding: 4px 16px 12px; }
.calWin .qSearchSlot.calSearch { display: flex; align-items: stretch; width: calc(100% - 80px); height: 49px; margin: 0 40px; padding: 5px 5px 10px; border-bottom: 0;
    box-sizing: border-box; } /* (the calendar's search, above the faces: the Quests list's (.qMissBar's height and padding, the box stretched to it); the side padding keeps it clear of the close button) */

.modalLegal {
    clear: both;
    margin: 18px auto 0;
    text-align: center;
    font-size: 12px;
    position: sticky;
    top: calc(100% - 1.6em);
    color: #9b9b9b;
    border-top: 1px solid var(--line);
    padding-top: 2px;
    width: fit-content;
    padding-left: 15px;
    padding-right: 15px;
}
#cmc, #mc { flex-grow: 1; } /* (the scrolling part fills the window: a short list's privacy links (.modalLegal, sticky) at the window's bottom) */

.modalLegal a {
	color: #9b9b9b;
}
.chFaceLink .qFace { width: 18px; height: 18px; margin: -3px 4px -2px 0; vertical-align: middle; border-radius: 50%; } /* (a character's link with its small face in it: app.js charFaceLink) */
.bmLootList li.bmCellRow { cursor: pointer; } /* (a chest / ground item row: its tile's tooltip on the map, app.js [data-bmcell]) */
.bondIc { width: auto; height: 1.7em; vertical-align: middle; margin: -0.2em 0; } /* (a mount's bond level: the game's gold heart with its number, app.js bondIcon) */
.gSpoil, .tutPage .acqSpoil { display: flow-root; } /* (a guide's spoiler block: beside a floated picture (.tutPics), not under it, so its blur stays off the picture) */
@media (max-width: 700px) { .gdChart .gcEnd, .gdChart .gcEndMark { display: none; } } /* (a phone: the end labels do not fit beside the chart; the legend above names the lines) */
/* the notable deeds guide (app.js deedCards): a card a deed as the game's deed list (Obelisk_Trophy_MenuItem): the category's round icon, the deed, and under it
   the Karma Shards (its shard icon, Icon_System IconStock_Causation) and the total; the quest list rows' frame and colours */
.gdDeeds { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; }
.gdDeed { display: grid; grid-template-columns: 1.5em minmax(0, 1fr); gap: 0 6px; align-items: start; padding: 4px 6px 4px 4px; border: 1px solid var(--border-quest-row); background: var(--surface-quest-tab); }
.gdDeedIc { width: 1.5em; height: 1.5em; }
.gdDeedTxt { font-family: "Nocturne", serif; color: var(--fg); }
.gdDeedLine { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2px 16px; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); font-size: 14px; color: var(--bCol); }
.gdDeedShards { display: inline-flex; align-items: center; gap: 6px; color: var(--fg); }
.gdShardIc { width: 20px; height: 20px; flex: none; }
.gdDeedAll { display: inline-flex; align-items: center; gap: 6px; }
.gdDeedAll b { color: var(--fg); font-weight: normal; }
/* a table cell's smaller second line (a boon's effect under its name) */
.gdTbl .gdLine.gdSub { font-size: 90%; color: var(--bCol); 
	min-width: 7em;}
/* a guide table header given as an icon ([renown]: app.js guideDataHtml): the renown icon, a little larger than in the text, named on hover */
.gdTbl .gdHdIc .rnIc { width: 1.35em; height: 1.35em; vertical-align: -0.3em; margin: 0; }
/* a guide table without its header row (nohead: the bond levels): as wide as its content; a mount bond level icon in a cell ([bond:N]) at a readable size */
.gdTbl.gdNoHead { width: auto; min-width: 220px; }
.gdTbl td .bondIc, .gdTbl th .bondIc { width: 34px; height: 34px; vertical-align: middle; margin: 0; }
.gdTbl.gdNoHead th, .gdTbl.gdNoHead td { vertical-align: middle; }
/* a stat's icon before its short name in a guide's text (app.js guideStatIcons): the game's stat icon (images/stat-icons, --ic) as a mask in the text's own colour */
.gdStatIc { display: inline-block; width: 1em; height: 1em; margin: 0 2px 0 1px; vertical-align: -0.14em; background: currentColor; opacity: .85;
	-webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
/* a performance quest's performance rewards (app.js buildQuestDetail: rewards.performance / performance3): a small heading over their rows */
.qRewHead { margin: 10px 0 2px; padding: 0 4px; font-size: 13px; color: var(--bCol); }
/* the places an objective lists ("Perform at the following locations:", app.js buildQuestDetail goalList): a line each under it */
.qGoalList { display: flex; flex-direction: column; gap: 3px; margin: -2px 0 6px 12px; }
/* a clash's popup (app.js buildClashDetail): a unit's class and weapon on a second line, the arena match's note, a quest line's label */
.clUnit .qRewName small { display: block; margin-left: 0; }
.clUnit .qRewName small .si, .clUnit .qRewName small img { width: 16px; height: 16px; vertical-align: -3px; }
.clNote { font-size: 90%; color: var(--bCol); margin-top: 4px; }
.clLabel { opacity: .8; margin-right: 4px; }
.idChip .clIf { margin-left: 4px; opacity: .85; } /* (a clash after an optional event: "Only if ... was seen") */
.clUnit { max-width: 560px; }
.scTapNote { font-size: 92%; color: var(--bCol); margin: 6px 0 2px; } /* (the builder: "Click/tap a stat to view its details.", above the conclusion) */
/* a stat's growth overview in its details (app.js statGrowthOverviewHtml) */
.gOv { margin-top: 8px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.15); }
.gOvHead { font-weight: bold; margin-bottom: 4px; }
.gOvTable { border-collapse: collapse; font-size: 90%; margin-bottom: 4px; }
.gOvTable td { padding: 2px 6px 2px 0; vertical-align: top; white-space: nowrap; }
.gOvTable td:nth-child(3) { white-space: normal; min-width: 120px; }
.gOvTable td:last-child { text-align: right; }
.gOvTable .si, .gOvTable img { width: 16px; height: 16px; vertical-align: -3px; margin: 0; margin-right: 3px; }
.gOvTable small { opacity: .8; }
.gOvTable td:nth-child(2), .gOvTable td:nth-child(3) { text-align: left; }
.gOvTable td { border: 0; }
.gOvTable { width: 100%; table-layout: auto; }
.gOvTable td:nth-child(2) { white-space: normal; }
.gOvTable td:nth-child(3) { min-width: 0; }

/* (a Part III item on a Part I tab: its whole line one blurred block, map.js itemRows) */
.lmP3Row { display: block; }

/* a character's supports (app.js supportRankList): one line per rank, the rank's letter, its part and paths as tags, its notes after them */
.supCell { vertical-align: middle; padding-top: 6px; padding-bottom: 6px; }
.supRanks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.supLine { display: flex; align-items: flex-start; gap: 8px; }
.supRank {
	flex: none;
	width: 1.5em;
	height: 1.5em;
	line-height: 1.5em;
	text-align: center;
	border: 1px solid var(--border-control);
	background-color: var(--surface-control);
	color: var(--text-stat-raised);
	font-weight: bold;
}
.supRankNone { visibility: hidden; }
.supBody { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-height: 1.5em; min-width: 0; }
.supTag {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 0 8px;
	border: 1px solid var(--border-control);
	border-radius: 999px;
	font-size: 0.92em;
	line-height: 1.5;
	color: var(--text-stat-label);
	white-space: nowrap;
}
.supPath { padding-left: 2px; }
.supTag .qFace { margin: 0 2px 0 0; }
.supNote { color: var(--text-faded); font-size: 0.92em; }
.supPaired { display: inline-flex; align-items: center; white-space: nowrap; }
/* (a rank that has to be seen by the end of a Part, or the next one never unlocks: supports.json lock, fw-tools/add-support-locks.mjs) */
.supLock { color: var(--text-warning); border-color: currentColor; white-space: normal; }
/* (the paired ending mark in a supports line: a pill like the Part / path tags, in the paired mark's pink) */
.supPaired .pairMark {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border: 1px solid #3c494a;
    border-radius: 999px;
    font-size: 0.92em;
    line-height: 1.5;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
    gap: 5px;
    background-color: #0d2125;
}
.supPaired .pairMark small { font-size: inherit; }
/* the supports table's character cell: the name on top, the portrait under it; the row is as tall as three rank lines (C + B + A: 3 × 1.5em
   badges + 2 × 4px gaps), so every row has the same height unless its tags wrap */
.supportTable th.supportCh {
	--supRows: calc(4.5em + 8px);
	height: var(--supRows);
	padding: 6px 0;
	text-align: center;
	vertical-align: top;
	background-position: center bottom;
	background-size: auto calc(100% - 1.6em);
}
.supportTable th.supportCh a {
	display: block;
	margin-left: 0;
	line-height: 1.3;
	white-space: nowrap;
}
.supportTable .supCell { height: calc(4.5em + 8px); }
