/* The map editor (js/view_maps.js): the Maps workspace (map list | one row of edit tools over columns of tabbed
   panels | the "About this map" drawer) and the floating map windows that open over another workspace.
   A panel is one map: its tab (or the window's title bar), the table and one status line. The cells grow with the
   pane (js: fitCells sets --cw / --ch / --gfs on the table), heat colours, the axis names on the axes. The edit tools
   are one row for the table in hand; Table · Graph · 3D and Show are on the toolbar, for every open map.
   Colours come from themes.css only. */

/* ---------------------------------------------------------------- the Maps workspace */
#screen-maps { overflow: hidden; }
.mx { display: grid; grid-template-columns: var(--mx-list-w, 400px) 5px minmax(0, 1fr) min(var(--help-w), 40vw); height: 100%; min-height: 0; min-width: 0; }
.mx.nohelp { grid-template-columns: var(--mx-list-w, 400px) 5px minmax(0, 1fr); }
.mx.nohelp > .mx-help { display: none; }

/* ---- the map list: a tree with a whole-row selection, one line per map */
.mx-list { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface); }
.mx-lhead { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); flex: none; background: var(--surface-2); }
.mx-lhead input[type=search] { width: 100%; }
.mx-lrow { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.mx-lv { display: inline-flex; align-items: center; gap: 7px; color: var(--text); }
.mx-chk { display: flex; gap: 7px; align-items: center; color: var(--text); cursor: pointer; min-height: 32px; }
.mx-lbody { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.mx-foot { padding: 0 10px; min-height: 28px; display: flex; align-items: center; color: var(--text-2); font-size: 14px; border-top: 1px solid var(--line); flex: none; background: var(--surface-2); }
.tree { list-style: none; margin: 0; padding: 3px 3px 12px; }
.tree li { display: flex; align-items: center; gap: 7px; padding: 4px 8px 4px 6px; min-height: 32px; cursor: pointer; border: 1px solid transparent; border-radius: 2px; line-height: 1.3; }
.tree li:hover { background: var(--surface-2); }
.tree .t-cat { font-weight: 600; min-height: 34px; }
.tree .t-cat.active, .tree .t-item.active, .tree .t-sub.active { background: var(--sel-bg); border-color: #9DC2EA; }
.tree .t-cat .tw { width: 18px; flex: none; color: var(--text); font-size: 20px; line-height: 1; text-align: center; }
.tree .t-cat .cnt { margin-left: auto; color: var(--off-text); font-weight: 400; font-size: 14px; flex: none; }
.tree .t-cat .swatch { display: none; }
.tree .t-sub { padding: 8px 8px 2px 18px; min-height: 0; font-size: 14px; color: var(--text-2); cursor: default; font-weight: 600; }
.tree .t-sub:hover { background: transparent; }
.tree .t-item, .tree .t-item.flat { padding-left: 14px; }
.tree .t-item .ic { width: 16px; flex: none; color: var(--off-text); font-size: 14px; text-align: center; }
.tree .t-item.open .nm { font-weight: 600; }
.tree .t-item.unused { opacity: .5; }
.tree .t-item .dot { margin-left: auto; flex: none; }
/* a name on one line; one that does not fit ends in … and carries the full name as its tooltip (js: tipNames) */
.tree .nm { min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree .nm:has(.raw) { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.tree .raw { display: block; color: var(--off-text); font: 12px var(--mono); }
.tree .lv { flex: none; font-size: 14px; color: var(--text-2); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; }
.mx-split { cursor: col-resize; background: var(--chrome-2); border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); position: relative; z-index: 3; }
.mx-split:hover, .mx-split.on { background: var(--accent); }

/* ---- the workspace: one row of edit tools, then columns of tabbed panels */
.mx-ws { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--chrome); }
.mx-bar { display: flex; align-items: center; gap: 4px 10px; min-height: 42px; padding: 4px 8px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); flex: none; flex-wrap: wrap; container-type: inline-size; container-name: tools; }
.mx-bar > .mx-edit { flex: 0 1 auto; padding: 0; border: 0; background: transparent; }
.mx-bar-r { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.mx-bar-r .btn.on { background: var(--sel-bg); border-color: #9DC2EA; }
.mx-cols { display: flex; flex: 1 1 0; min-width: 0; min-height: 0; }
.mx-col { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line-2); background: var(--bg); }
.mx-col:first-child { border-left: 0; }
.mx-col.dropto { outline: 2px dashed var(--accent); outline-offset: -3px; }
.mx-tabbar { display: flex; align-items: flex-end; background: var(--chrome-2); border-bottom: 1px solid var(--line-2); min-height: 36px; flex: none; padding: 0 4px 0 4px; }
.mx-tabs { display: flex; align-items: flex-end; gap: 2px; overflow: hidden; flex: 0 1 auto; min-width: 0; align-self: stretch; padding-top: 4px; }
.mx-tab { display: flex; align-items: center; gap: 2px; padding: 0 0 0 12px; height: 33px; border: 1px solid transparent; border-bottom: 0; border-radius: 4px 4px 0 0; cursor: pointer; color: var(--text); white-space: nowrap; user-select: none; flex: none; position: relative; top: 1px; }
.mx-tab:hover:not(.on) { background: var(--chrome); border-color: var(--line); }
.mx-tab.on { background: var(--bg); border-color: var(--line-2); font-weight: 600; box-shadow: inset 0 2px 0 var(--line-2); }
.mx-col.focus .mx-tab.on, .mx-cols > .mx-col:only-child .mx-tab.on { box-shadow: inset 0 2px 0 var(--accent); }
.mx-tab.wrap { white-space: normal; flex: 1 1 auto; min-width: 0; height: auto; min-height: 32px; }
.mx-tab.wrap .mx-tl { line-height: 1.15; padding: 2px 0; }
.mx-tl .tag, .fw-t .tag { margin-left: 8px; vertical-align: 1px; font-weight: 400; }
.mx-tx { border: 0; background: transparent; color: var(--text-2); width: 32px; height: 32px; border-radius: 3px; cursor: pointer; font-size: 18px; line-height: 1; padding: 0; }
.mx-tx:hover { background: var(--chrome-3); color: var(--text); }
.mx-tmore { flex: none; min-width: 40px; height: 32px; align-self: center; margin: 0 4px; border: 1px solid var(--line-2); border-radius: var(--r); background: #FFFFFF; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; padding: 0 8px; }
.mx-tmore:hover { border-color: var(--accent); }
.mx-tmenu { display: flex; flex-direction: column; min-width: 240px; }
.mx-tmi { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid #E6E9ED; padding: 2px 0; }
.mx-tmi:last-child { border-bottom: 0; }
.mx-tmi .btn { min-height: 32px; text-align: left; justify-content: flex-start; flex: 1 1 auto; }
.mx-tmi .mx-tmx { flex: none; width: 32px; justify-content: center; }
.mx-tacts { display: flex; align-items: center; gap: 3px; padding: 0 2px 0 8px; flex: none; margin-left: auto; align-self: center; }
.mx-tbtn, .fw-btn { min-width: 32px; height: 32px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--text); cursor: pointer; font-size: 17px; line-height: 1; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: none; }
.mx-tbtn:hover:not(:disabled), .fw-btn:hover { background: #FFFFFF; border-color: var(--line-2); }
.mx-tbtn:disabled { color: var(--off); cursor: default; }
.fw-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mx-dropnew { position: absolute; right: 0; top: 0; bottom: 0; width: 34%; display: flex; align-items: center; justify-content: center; z-index: 20; border: 2px dashed var(--accent); background: rgba(217, 232, 248, .85); color: var(--text); font-weight: 600; }
.mx-dropnew.over { background: rgba(15, 98, 184, .35); }

/* ---- the edit tools: ONE row for the table in hand (the bar of Maps, or the strip of the map window in hand):
        a value, = + − %, then Interpolate / Revert / Undo, then what belongs to this one table */
.map-tools { display: flex; align-items: center; gap: 4px; padding: 4px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; flex: none; background: var(--surface-2); }
.map-tools .btn.sm { min-height: 32px; padding: 0 11px; }
.map-tools .sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 5px; }
.mx-edit input[type=number] { width: 84px; }
.mx-edit .btn.gl { min-width: 34px; padding: 0 6px; font-size: 17px; font-weight: 600; line-height: 1; }
.btn.ib { display: inline-flex; align-items: center; gap: 6px; }
.btn.ib .mx-sv, .mx-bar-r .mx-sv { width: 18px; height: 18px; }
.btn.ib.only { padding: 0 7px; min-width: 34px; justify-content: center; }
.mx-ovl { display: inline-flex; align-items: center; gap: 7px; margin-left: 6px; color: var(--text); }
/* a narrow bar or window: the three named tools keep their icon (their name is the tooltip) */
@container tools (max-width: 560px) {
  .mx-edit .btn.ib .bl { display: none; }
  .mx-edit .btn.ib { padding: 0 8px; }
  .mx-edit input[type=number] { width: 72px; }
  .mx-edit .btn.gl { min-width: 32px; }
  .mx-edit .sep { margin: 0 3px; }
}
@container tools (max-width: 760px) { .mx-bar-r .bl { display: none; } }

/* ---- the "About this map" panel */
.mx-help { border-left: 1px solid var(--line-2); background: var(--surface); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.mx-help-h { justify-content: space-between; padding-right: 2px; }
.mx-helpb { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.help h4 { font-size: 14px; color: var(--text-2); font-weight: 600; margin: 0 0 3px; }
.help .hs { padding: 9px 10px; border-bottom: 1px solid #E6E9ED; overflow-wrap: anywhere; }
.help .hs p + p { margin-top: 5px; }
.help ul { margin: 3px 0 0; padding-left: 16px; } .help li { margin: 2px 0; }
.help .raw { font: 12px var(--mono); color: var(--text-2); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- a panel (a Maps tab or a floating window) */
/* the base text of a table: 14 px on a laptop, 16 px on a big screen, times the zoom (View › Zoom) */
.mx-panel { flex: 1 1 0; min-height: 0; min-width: 0; display: flex; flex-direction: column; border-right: 0; background: var(--bg); container-type: inline-size; --cell-fs: 14px; }
@media (min-width: 1700px) and (min-height: 950px) { .mx-panel { --cell-fs: 16px; } }
.sentence { padding: 6px 12px; border-bottom: 1px solid var(--line); color: var(--text); flex: none; }
.map-body { flex: 1 1 0; min-height: 0; min-width: 0; display: flex; }
/* Graph / 3D with the table kept: beside the picture, or over it (js: layoutBody gives the table its share) */
.map-body.split-below { flex-direction: column; }
.map-body.split-beside > .mx-axes, .map-body.split-beside > .gridwrap { flex: 0 0 auto; border-right: 1px solid var(--line); }
.map-body.split-below > .mx-axes, .map-body.split-below > .gridwrap { flex: 0 0 auto; border-bottom: 1px solid var(--line); }
.mx-axes { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; min-height: 0; }
.mx-xax { flex: none; padding: 4px 8px; color: var(--text); font-weight: 600; text-align: center; white-space: normal; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.mx-grid2 { display: flex; flex: 1 1 0; min-width: 0; min-height: 0; }
.mx-yax { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; padding: 6px 4px; flex: none; color: var(--text); font-weight: 600; background: var(--surface-2); border-left: 1px solid var(--line); white-space: normal; max-height: 100%; }
.mx-xax span, .mx-yax span { white-space: normal; }
.gridwrap { flex: 1 1 0; min-width: 0; min-height: 0; overflow: auto; outline: 0; position: relative; }
/* the keyboard focus is shown on the table itself, not as a frame around the whole pane */
.gridwrap:focus-visible { outline: 0; }
.gridwrap:focus-visible > table.grid { outline: 1px solid var(--line-2); outline-offset: -1px; }
table.grid { border-collapse: separate; border-spacing: 0; font-family: var(--grid-font); font-variant-numeric: tabular-nums; font-size: var(--cell-fs); }
table.grid, .gridwrap, .lg .lg-hgrid { -webkit-user-select: none; user-select: none; }
table.grid th, table.grid td { height: var(--cell-h); padding: 0 var(--cell-pad); text-align: right; white-space: nowrap; border-right: 1px solid var(--grid-line); border-bottom: 1px solid var(--grid-line); }
table.grid thead th { position: sticky; top: 0; z-index: 3; background: #E7EAEE; color: var(--text); font-weight: 600; border-bottom: 1px solid var(--line-2); }
table.grid th.rowh { position: sticky; left: 0; z-index: 2; background: #E7EAEE; color: var(--text); font-weight: 600; min-width: var(--rowh-w); border-right: 1px solid var(--line-2); }
table.grid th.corner { position: sticky; left: 0; top: 0; z-index: 4; text-align: center; color: var(--text); font-weight: 600; font-family: var(--font); white-space: normal; min-width: var(--rowh-w); line-height: 1.15; border-right: 1px solid var(--line-2); }
table.grid th.hot { background: #C9DDF3; }
table.grid th.livehot { color: var(--live); }
table.grid td { color: var(--cell-text); cursor: cell; position: relative; min-width: 42px; }
/* a map panel's table: the cells fill the pane (js: fitCells) */
.mx-panel table.grid { font-size: var(--gfs, calc(var(--cell-fs) * var(--map-zoom, 1))); }
.mx-panel table.grid th, .mx-panel table.grid td { height: var(--ch, var(--cell-h)); }
.mx-panel table.grid th[data-c], .mx-panel table.grid td { min-width: var(--cw, 42px); }
table.grid td.sel { box-shadow: inset 0 0 0 1px var(--sel-line), inset 0 0 0 99px var(--sel-fill); }
table.grid td.cur { box-shadow: inset 0 0 0 2px #0A2540; }
table.grid td.changed::after { content: ""; position: absolute; top: 0; right: 0; border: 4px solid var(--changed); border-left-color: transparent; border-bottom-color: transparent; }
/* MS41: a changed cell is seen at a glance on the heat colours: a line around it and bold text */
table.grid.fam41 td.changed { box-shadow: inset 0 0 0 1.5px var(--changed); font-weight: 700; }
table.grid.fam41 td.changed.sel { box-shadow: inset 0 0 0 1.5px var(--changed), inset 0 0 0 99px var(--sel-fill); }
table.grid td.live { outline: 2px solid var(--live); outline-offset: -2px; z-index: 1; }
table.grid td.trail { box-shadow: inset 0 0 0 1px var(--live); }
table.grid td.ro { cursor: default; }
table.grid td.ovcell { color: var(--text); }
table.grid td.noknk { background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, .2) 0 2px, transparent 2px 7px); }
table.grid td.ink-dark { color: #101317; } table.grid td.ink-light { color: #FFFFFF; }
table.grid td.odiff::before { content: ""; position: absolute; left: 0; bottom: 0; border: 4px solid var(--live); border-right-color: transparent; border-top-color: transparent; }
table.grid td input { position: absolute; inset: 0; width: 100%; min-height: 0; height: 100%; border: 2px solid var(--focus); border-radius: 0; padding: 0 4px; text-align: right; background: var(--input); color: var(--text); font: inherit; -webkit-user-select: text; user-select: text; }
table.grid.col2 th, table.grid.col2 td { padding: 0 14px; }
table.grid.col2 thead th, .mx-panel table.grid.col2 thead th { text-align: right; white-space: normal; line-height: 1.2; height: auto; padding-top: 5px; padding-bottom: 5px; font-family: var(--font); max-width: 180px; vertical-align: bottom; }
table.grid.col2 thead th.corner { white-space: normal; max-width: 220px; min-width: 100px; }
.mx-panel table.grid.col2 th.rowh, .mx-panel table.grid.col2 thead th.corner { min-width: var(--rw, 100px); }
.mx-panel table.grid.col2 thead th.corner { max-width: max(220px, var(--rw, 0px)); }
.mx-panel table.grid.col2 thead th[data-c] { max-width: max(180px, var(--cw, 0px)); }
table.grid th.derived, table.grid td.derived { background: var(--surface-2); color: var(--text-2); font-family: var(--font); }
table.grid.col2 thead th.derived { max-width: 130px; }
/* a difference: the cells that are the same are grey zeros, the ones that differ carry the signed change in colour */
.isdiff table.grid td:not(.ovcell) { color: var(--diff-ink); font-weight: 600; }
.isdiff table.grid td.same:not(.ovcell) { color: var(--off-text); font-weight: 400; background: var(--surface-2); }
.mx-rz { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 6; }
.mx-rz:hover { background: rgba(15, 98, 184, .4); }
.chart { flex: 1 1 0; min-width: 0; min-height: 0; position: relative; background: #FFFFFF; }
.chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the one status line of a panel */
.map-status { display: flex; gap: 2px 16px; align-items: center; padding: 3px 12px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 14px; flex: none; flex-wrap: wrap; min-height: 30px; background: var(--surface-2); }
.map-status > span { white-space: nowrap; }
.map-status .e { color: var(--fault); font-weight: 600; }
.map-status .legend { gap: 2px 12px; }
.mx-nchg { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
#map-showing.c-live, [data-id=map-showing].c-live { color: var(--accent); font-weight: 600; }
.mx-knk i { display: inline-block; width: 14px; height: 10px; margin-right: 5px; vertical-align: -1px; border: 1px solid var(--line-2); background: repeating-linear-gradient(135deg, var(--text-2) 0 1px, transparent 1px 4px); }

/* ---- pages: a category, all maps, differences */
.mx-page { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.mx-page .grp-h.sub { min-height: 34px; background: var(--surface-2); }
.mx-page .grp-h.sub h3 { font-size: 14px; color: var(--text); }
.grp-h.late h3 { color: var(--text-2); }
/* a setting: one compact row (name | control | its (i) while the row is in hand); a line under it only when it has
   something to say now (a refused value, the compare bin's value, what a switch does at its setting) */
.field { display: grid; grid-template-columns: minmax(0, 5fr) minmax(220px, 4fr) 32px; gap: 0 12px; align-items: center; padding: 4px 12px 4px 28px; min-height: 42px; border-bottom: 1px solid #E6E9ED; cursor: default; position: relative; max-width: 1100px; }
.field.changed::before { content: ""; position: absolute; left: 10px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--changed); }
.field.changed .f-name { font-weight: 700; }
.field.active { background: var(--sel-bg); } .field.unused { opacity: .55; }
.field .f-name { font-weight: 600; grid-column: 1; grid-row: 1; }
.field .f-what { color: var(--text-2); grid-column: 1 / 3; grid-row: 2; padding-bottom: 3px; }
.field .f-what:empty { display: none; }
.field .f-inp { display: flex; align-items: center; gap: 6px; grid-row: 1; grid-column: 2; flex-wrap: wrap; }
.field .f-inp input[type=number] { width: 110px; }
.field .f-u { color: var(--text-2); }
.field .f-i { grid-row: 1; grid-column: 3; }
.field .f-was { color: var(--text-2); white-space: nowrap; }
.field.wide-ctl { grid-template-columns: minmax(0, 1fr) 32px; }
.field.wide-ctl .f-inp { grid-row: 2; grid-column: 1; margin: 2px 0 4px; }
.field.wide-ctl .f-inp select { max-width: 100%; }
.field.wide-ctl .f-what { grid-row: 3; grid-column: 1; }
.field.wide-ctl .f-i { grid-row: 1; grid-column: 2; }
.tlist-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 1px 8px; padding: 7px 12px; border-bottom: 1px solid #E6E9ED; cursor: pointer; align-items: center; }
.tlist-row:hover { background: var(--surface-2); }
.tlist-row .f-name { font-weight: 600; }
.tlist-row .f-what { grid-column: 2 / 4; color: var(--text-2); } .tlist-row .dims { color: var(--text-2); font-variant-numeric: tabular-nums; }
/* the tables of a category: tiles, each with a small live picture of the table (its heat map, or its curve) */
.mx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; padding: 10px 12px 14px; border-bottom: 1px solid var(--line); }
.mx-card { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); cursor: pointer; }
.mx-card:hover, .mx-card:focus-visible { border-color: var(--accent); background: var(--sel-bg); }
.mx-card.unused { opacity: .55; }
.mx-thumb { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; border: 1px solid var(--line-2); border-radius: 2px; background: #FFFFFF; }
.mx-card .f-name { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.mx-card.changed .f-name { font-weight: 700; }
.mx-card .dims { display: flex; align-items: center; gap: 6px; margin-top: auto; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mx-card .raw { display: block; color: var(--off-text); font: 12px var(--mono); overflow-wrap: anywhere; }
.mx-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; padding: 12px; }
.mx-tile { text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: linear-gradient(#FFFFFF, #F0F2F5); color: var(--text); cursor: pointer; font: inherit; }
.mx-tile:hover { border-color: var(--accent); background: var(--sel-bg); }
.mx-tile b { font-size: 15px; }
.mx-tile .muted { display: flex; align-items: center; gap: 6px; }
/* the list of differences: one head row, then rows to open; a table's cells behind its "Cells" button */
.diff-head { gap: 4px 14px; min-height: 42px; }
.diff-ref { color: var(--text-2); min-width: 0; overflow-wrap: anywhere; } .diff-ref b { color: var(--text); font-weight: 600; }
.diff-sum { color: var(--text-2); white-space: nowrap; } .diff-sum b { color: var(--text); }
#diff-none p { margin-bottom: 12px; }
.diff-row { display: grid; grid-template-columns: 18px minmax(96px, 1fr) fit-content(58%) auto; gap: 3px 12px; padding: 3px 12px; min-height: 40px; border-bottom: 1px solid #E6E9ED; cursor: pointer; }
.diff-row.diff-fold, .diff-row.diff-line { cursor: default; }
.diff-row.sub { padding-left: 34px; background: var(--surface-2); }
.diff-row .f-name { font-weight: 600; color: var(--text); }
.diff-row.changed .f-name { font-weight: 700; }
.diff-row .dval { color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.diff-row .dval b { color: var(--text); } .diff-row .dval s { color: var(--text-2); }
.diff-row .mx-more, .diff-row .mx-fold { min-width: 64px; justify-content: center; }
.diff-cellwrap { padding: 4px 12px 12px 38px; max-height: 340px; overflow: auto; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.diff-cells th, .diff-cells td { padding: 2px 12px 2px 0; text-align: right; }
table.diff-cells { width: auto; min-width: 420px; }
table.diff-cells th { white-space: normal; max-width: 220px; vertical-align: bottom; background: transparent; }
.diff-cells td.c-up { color: var(--changed); } .diff-cells td.c-down { color: var(--live); }

/* a panel in a narrow column (two or three side by side) or a small window: the status line packed tighter */
@container (max-width: 640px) {
  .map-status { padding: 3px 8px; gap: 2px 10px; }
}

/* ---------------------------------------------------------------- floating map windows */
.floats { position: absolute; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.fw { position: absolute; pointer-events: auto; display: flex; flex-direction: column; min-width: 300px; min-height: 160px; background: var(--bg); border: 1px solid #6F7884; border-radius: 4px; box-shadow: 0 10px 30px rgba(20, 28, 40, .30); overflow: hidden; }
.fw.focus { border-color: var(--accent); box-shadow: 0 12px 36px rgba(20, 28, 40, .38); }
.fw-h { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 3px 0 10px; background: var(--chrome-3); border-bottom: 1px solid var(--line-2); cursor: move; flex: none; user-select: none; font-weight: 600; }
.fw.focus .fw-h { background: var(--accent); color: #FFFFFF; border-bottom-color: var(--accent-2); }
.fw-ic { flex: none; opacity: .8; }
.fw-t { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; line-height: 1.2; padding: 4px 0; }
.fw .fw-btn { color: inherit; height: 32px; font-size: 14px; font-weight: 400; }
.fw.focus .fw-btn:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .5); }
.fw .fw-dock { padding: 0 9px; }
/* the one row of edit tools: in the window in hand only (js: setFloatTools) */
.fw-tools { display: none; padding: 4px 6px; gap: 3px; container-type: inline-size; container-name: tools; }
.fw.hastools .fw-tools { display: flex; }
.fw-b { flex: 1 1 0; min-height: 0; }
.fw-rz { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; z-index: 8; background: linear-gradient(135deg, transparent 0 50%, #8D95A1 50% 56%, transparent 56% 68%, #8D95A1 68% 74%, transparent 74% 86%, #8D95A1 86% 92%, transparent 92%); }

/* ---------------------------------------------------------------- the toolbar's Show group: Current · Original · the compare bin, and the Difference switch beside them */
#map-compare { display: inline-flex; align-items: center; gap: 6px; }

/* MS41: settings inside a configuration byte; the sentence and unit on a tile; the mark of an item only a definition file knows */
.field.parts { display: block; padding: 0; min-height: 0; border: 0; }
.field.parts.changed::before { display: none; }
.field.parts > .f-name { padding: 6px 12px 0 28px; }
.f-part { display: grid; grid-template-columns: minmax(0, 5fr) minmax(220px, 4fr) 32px; gap: 0 12px; align-items: center; padding: 4px 12px 4px 28px; min-height: 42px; border-bottom: 1px solid #E6E9ED; position: relative; }
.f-part.changed::before { content: ""; position: absolute; left: 10px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--changed); }
.f-part .f-pt { font-weight: 600; } .f-part.changed .f-pt { font-weight: 700; }
.f-part .f-pi { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.f-part select { max-width: 100%; }
.mx-card .what { color: var(--text-2); line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.mx-card .dims { flex-wrap: wrap; } .mx-card .dims .unit { margin-left: auto; text-align: right; }
.deffile { margin-left: 6px; color: var(--off-text); font-size: 12px; cursor: help; }
