/* Shared map ("the Table", js/map.js). The map fills the window; the page (sheet, GM screen...) sits in a
   resizable column on the right (an iframe), and the party chat is pinned into the bottom of that column. */
body.table-mode { overflow: hidden; }
body.table-mode .banner, body.table-mode .subbar, body.table-mode .foot { display: none; }
body.table-mode main { max-width: none; padding: 0; }
.tbl { position: fixed; inset: 0; z-index: 30; display: flex; background: #0d0b09; }
.tbl-map { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.tm-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: default; }

/* The page column */
.tbl-resize { width: 6px; flex: none; cursor: col-resize; background: var(--line); touch-action: none; }
.tbl-resize:hover, .tbl-resizing .tbl-resize { background: var(--gold-dim); }
.tbl-dock { position: relative; flex: none; width: var(--dock-w, 440px); background: var(--bg); display: flex; flex-direction: column; }
.tbl-page { flex: 1; width: 100%; border: 0; display: block; background: var(--bg); }
.tbl-resizing .tbl-page { pointer-events: none; }
.tbl-back { display: none; }
body.table-mode:not(.dock-on) .tbl-resize, body.table-mode:not(.dock-on) .tbl-dock { display: none; }

/* The party chat inside the page column (chat.js is unchanged: its floating window is placed here).
   The page above gets shorter while the chat is open. */
body.table-mode.dock-on .chat-win:not(.chat-full) { right: 0; bottom: 0; width: var(--dock-w); height: var(--chat-h, 44vh);
  max-height: calc(100vh - 160px); border-radius: 12px 0 0 0; border-right: 0; border-bottom: 0; }
body.table-mode.dock-on .chat-fab { right: calc(var(--dock-w) + 18px); }
body.table-mode.dock-on:has(.chat-dock.is-open) .tbl-page { flex: none; height: calc(100% - min(var(--chat-h, 44vh), 100vh - 160px)); }

/* Toolbar */
.tm-bar { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; align-items: center; gap: 6px; pointer-events: none; flex-wrap: wrap; }
.tm-bar > * { pointer-events: auto; }
.tm-gap { flex: 1; pointer-events: none; }
.tm-b { height: 34px; min-width: 34px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line2); color: var(--text);
  background: rgba(27, 22, 17, .88); backdrop-filter: blur(6px); font: 600 13px var(--sans); cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.tm-b:hover:not(:disabled) { border-color: var(--gold-dim); background: rgba(51, 40, 31, .95); }
.tm-b:disabled { cursor: default; opacity: 1; }
.tm-b.on { border-color: var(--gold); color: var(--gold2); }
.tm-name { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; font-family: var(--serif); font-size: 14px; }
.tm-name:not(:disabled) span::after { content: ' ▾'; color: var(--muted); }
.tm-live { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); }
.tm-live[data-s="live"] { background: #5fd35a; }
.tm-live[data-s="retrying"], .tm-live[data-s="connecting"] { background: #e0a83a; }
.tm-live[data-s="down"] { background: #e2584d; }
/* when it lasts: the dot says it in words (drawLive) */
.tm-live.tm-livew { width: auto; height: auto; padding: 3px 9px; border-radius: 999px; font: 600 11px var(--sans); color: #1a1208; white-space: nowrap; }
.tm-live.tm-livew[data-s="down"] { color: #fff; }

.tm-share { position: absolute; left: 50%; top: calc(var(--bar-b, 44px) + 10px); transform: translateX(-50%); padding: 7px 8px 7px 14px; border-radius: 10px;
  background: rgba(27, 22, 17, .92); border: 1px dashed var(--gold-dim); color: var(--gold2); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.tm-hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); max-width: 90%; padding: 9px 14px; border-radius: 10px;
  background: rgba(10, 8, 6, .9); border: 1px solid #4dd2ff; color: #cfefff; font-size: 13px; pointer-events: none; text-align: center; }
/* Lining up the grid: what to drag, how many squares, save (2026-12-06) */
.tm-align { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(520px, calc(100% - 20px)); padding: 10px 14px; border-radius: 10px;
  background: rgba(10, 8, 6, .93); border: 1px solid #4dd2ff; color: #cfefff; font-size: 13px; display: grid; gap: 8px; z-index: 5; }
.tm-align p { margin: 0; line-height: 1.4; }
.tm-align b { color: #fff; }
.tm-al-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tm-al-n { min-width: 22px; text-align: center; font-size: 15px; }
.tm-al-btns { display: flex; gap: 8px; margin-left: auto; }
.tm-al-res { color: #9fd8ee; }
.tm-al-warn { color: #ffd34d; }
.tm-progress { position: absolute; left: 50%; top: calc(var(--bar-b, 44px) + 10px); transform: translateX(-50%); padding: 10px 14px; border-radius: 10px; min-width: 260px;
  background: rgba(27, 22, 17, .95); border: 1px solid var(--line2); display: grid; gap: 6px; font-size: 13px; }
.tm-progress progress { width: 100%; accent-color: var(--gold); }
.tm-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; color: var(--muted); }
/* It covers the whole map area: let clicks through to the bar above it (← and the rest), except its own buttons */
.tm-empty { pointer-events: none; }
.tm-empty button, .tm-empty a { pointer-events: auto; }
.tm-empty h2 { font-family: var(--serif); color: var(--text); margin: 0 0 6px; }
.tm-empty p { margin: 6px auto; max-width: 440px; }

/* Tool palette: drawing tools, ruler, ping, style, undo */
.tm-tools { position: absolute; left: 10px; top: calc(var(--bar-b, 44px) + 12px); display: flex; flex-direction: column; gap: 3px; padding: 5px; border-radius: 12px;
  background: rgba(27, 22, 17, .9); backdrop-filter: blur(6px); border: 1px solid var(--line2); box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  max-height: calc(100% - 70px); overflow-y: auto; scrollbar-width: thin; }
/* the chosen tool's options, undo and redo: a second short column beside the tools */
.tm-opts { position: absolute; left: 62px; top: calc(var(--bar-b, 44px) + 12px); display: flex; flex-direction: column; gap: 3px; padding: 5px; border-radius: 12px;
  background: rgba(27, 22, 17, .9); backdrop-filter: blur(6px); border: 1px solid var(--line2); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); z-index: 5; }
.tm-opts[hidden] { display: none; }
.tm-t { flex: none; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px;
  background: none; color: var(--text); cursor: pointer; }
.tm-t svg { width: 20px; height: 20px; }
.tm-t:hover:not(:disabled) { background: var(--hover); }
.tm-t.on { background: var(--gold-dim); color: #fff; }
.tm-t.gmon { background: #2a6b8a; }
.tm-t:disabled { opacity: .35; cursor: default; }
.tm-sep { flex: none; height: 1px; background: var(--line2); margin: 3px 4px; }
/* the GM's layer button (Map / Tokens / GM, click for the next) at the top of the options column */
.tm-t.tm-ly { font: 700 9.5px/1 var(--sans); flex-direction: column; gap: 2px; display: flex; justify-content: center; align-items: center; background: var(--gold-dim); color: #fff; }
.tm-t.tm-ly small { font-size: 7.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; opacity: .75; }
.tm-t.tm-ly-map { background: #5a4a2a; }
.tm-t.tm-ly-gm { background: #2a6b8a; }
.tm-t.tm-ly-fg { background: #3e6b3a; }   /* the Foreground: pictures above the tokens */
.tm-lyb.on.tm-ly-fg { background: #3e6b3a; }   /* (the same in the top bar's Map | Tokens | Foreground | GM switch) */
.tbl-map[data-ly=fg] .tm-lytag { border-color: #5a9a52; color: #dff5da; }
.tm-color i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #000; }

/* Turn order strip (the campaign's encounter tracker) */
.tm-turns { position: absolute; left: 50%; top: calc(var(--bar-b, 44px) + 10px); transform: translateX(-50%); max-width: calc(100% - 130px); display: flex; align-items: center; gap: 6px;
  padding: 5px 6px; border-radius: 12px; background: rgba(27, 22, 17, .92); backdrop-filter: blur(6px); border: 1px solid var(--line2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.has-turns .tm-share { top: 104px; }
.tm-round { flex: none; padding: 0 6px; font: 700 12px var(--sans); color: var(--gold2); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.tm-tlist { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tm-te { flex: none; display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 4px; border-radius: 8px; border: 1px solid var(--line2);
  background: var(--bg2); color: var(--text); font: 600 13px var(--sans); cursor: pointer; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.tm-te b { min-width: 22px; padding: 2px 4px; border-radius: 5px; background: rgba(0, 0, 0, .35); font-size: 12px; color: var(--muted); text-align: center; }
.tm-te.tm-pc { border-color: #2f5f86; }
.tm-te.hid { opacity: .55; border-style: dashed; }
.tm-te.cur { background: var(--gold-dim); border-color: var(--gold); color: #fff; box-shadow: 0 0 10px rgba(255, 211, 77, .45); }
.tm-te.cur b { color: #fff; }
.tm-tb { flex: none; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text);
  font: 600 13px var(--sans); cursor: pointer; white-space: nowrap; }
.tm-tb.gold { background: var(--gold-dim); border-color: var(--gold); color: #fff; }

/* Token menu: HP, notes; conditions panel; monster stats in the dialog */
.tm-hp { display: flex; align-items: center; gap: 5px; padding: 4px 10px 8px; font-size: 14px; flex-wrap: wrap; }
.tm-hp span { margin-right: auto; }
.tm-hp b { font-size: 16px; }
.tm-hp input { width: 62px; }
/* extra bars in the token menu, and their setup dialog */
.tm-bar { display: flex; align-items: center; gap: 5px; padding: 2px 10px 4px; font-size: 13.5px; }
.tm-bar i { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.tm-bar span { margin-right: auto; }
.tm-bar small { font-size: 10px; color: #7fd3ff; margin-left: 3px; }
.tm-bar .btn.small { min-width: 30px; justify-content: center; }
/* (.tm-bar is also the toolbar's class: in the menu the row stays in the flow) */
.tm-pop .tm-bar { position: static; pointer-events: auto; flex-wrap: nowrap; }
.tm-bar .tm-barv { width: 46px; height: 30px; text-align: center; padding: 2px; }
.tm-ghp { padding: 4px 10px 4px; }
.tm-barset { border: 1px solid var(--line2); border-radius: 8px; padding: 6px 10px 8px; margin: 0 0 8px; }
.tm-barset legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
.tm-row2 { display: flex; gap: 8px; }
.tm-row2 label { flex: 1; min-width: 0; }
.tm-row2 input[type=number] { width: 100%; }
.tm-notes { margin: 0 10px 6px; padding: 6px 8px; border-radius: 6px; background: var(--bg2); font-size: 12px; color: var(--muted); white-space: pre-wrap; }
.tm-marks { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.tm-marks button { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 7px; border: 1px solid transparent; background: none;
  color: var(--text); font: 500 13px var(--sans); cursor: pointer; text-align: left; }
.tm-marks button:hover { background: var(--hover); }
.tm-marks button.on { border-color: var(--gold); background: var(--hover2); }
.tm-marks button.some { border-color: var(--gold); border-style: dashed; }   /* some of the selected tokens have it */
.tm-marks i { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 700 10px var(--sans); font-style: normal; color: #fff; box-shadow: 0 0 0 1px #000; }
.tm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.tm-stats input { width: 100%; }

/* Menus and the grid panel */
.tm-pop { position: absolute; z-index: 5; min-width: 230px; max-width: min(340px, calc(100% - 16px)); max-height: calc(100% - 70px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.tm-menu { display: grid; }
.tm-menu button { display: flex; justify-content: space-between; gap: 10px; align-items: center; text-align: left; padding: 8px 10px;
  border: 0; border-radius: 8px; background: none; color: var(--text); font: 500 14px var(--sans); cursor: pointer; }
.tm-menu button:hover:not(:disabled) { background: var(--hover); }
.tm-menu button:disabled { color: var(--faint); cursor: default; }
.tm-menu button.cur { background: var(--hover2); color: var(--gold2); }
.tm-menu button.danger { color: var(--down); }
.tm-menu em { font-style: normal; font-size: 12px; color: var(--gold); flex: none; }
.tm-menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; width: auto; }
.tm-mh { margin: 4px 10px 6px; font: 700 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tm-pop .fine { margin: 6px 10px 4px; font-size: 12px; color: var(--faint); }
.tm-panel { display: grid; gap: 9px; padding: 4px 6px 8px; font-size: 13px; }
.tm-panel label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tm-panel label.check { justify-content: flex-start; }
.tm-panel input[type=number] { width: 70px; }
.tm-panel select { max-width: 180px; }
.tm-step { display: inline-flex; align-items: center; gap: 3px; }
.tm-step button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); cursor: pointer; }
.tm-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.tm-swatches button.on { border-color: var(--gold2); box-shadow: 0 0 0 2px #000 inset; }

/* Step 6: the picture library (GM), notes, handouts */
.tm-lib { position: absolute; z-index: 4; top: calc(var(--bar-b, 44px) + 10px); right: 10px; bottom: 10px; width: 300px; display: flex; flex-direction: column; gap: 8px;
  padding: 8px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line2); box-shadow: var(--shadow); }
.tm-lib.drop { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dim), var(--shadow); }
.tm-lib-head { display: flex; align-items: center; justify-content: space-between; padding-left: 4px; font-family: var(--serif); font-size: 15px; }
.tm-lib-head .tm-t { width: 28px; height: 28px; font-size: 14px; }
.tm-lib-tools { display: flex; gap: 6px; }
.tm-lib-tools input { flex: 1; min-width: 0; }
.tm-lib-tools select { max-width: 130px; }
.tm-lib-up { display: flex; gap: 6px; flex-wrap: wrap; }
.tm-lib-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; align-content: start; }
.tm-lib-grid > .fine { grid-column: 1 / -1; margin: 10px 4px; color: var(--faint); font-size: 13px; }
.tm-li { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 4px; border-radius: 8px; border: 1px solid var(--line2);
  background: var(--bg2); color: var(--text); cursor: grab; text-align: left; font: 500 11px var(--sans); }
.tm-li:hover { border-color: var(--gold-dim); }
.tm-li img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; background: #0d0b09 repeating-conic-gradient(#1c1814 0 25%, transparent 0 50%) 0 0 / 12px 12px; }
.tm-li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-li em { position: absolute; top: 7px; font-style: normal; font-size: 10px; padding: 1px 5px; border-radius: 6px; background: rgba(0, 0, 0, .7); }
.tm-li em.k { left: 7px; color: #9fe3ff; }
.tm-li em.u { right: 7px; color: var(--gold2); }
.tm-lib-foot { margin: 0 4px; font: 12px/1.35 var(--sans); color: var(--faint); }
.tbl-map.lib-on .tm-share { left: calc(50% - 155px); }
.tm-note { display: grid; max-width: 320px; }
.tm-notetext { margin: 0 10px 8px; white-space: pre-wrap; font-size: 14px; line-height: 1.45; max-height: 50vh; overflow-y: auto; }
.tm-handout { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 18px; background: rgba(5, 4, 3, .82); }
.tm-ho-box { display: flex; flex-direction: column; gap: 8px; max-width: 100%; max-height: 100%; padding: 10px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line2); box-shadow: var(--shadow); }
.tm-ho-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 4px; }
.tm-ho-head b { font-family: var(--serif); font-size: 18px; color: var(--gold2); }
.tm-ho-pic { min-height: 0; flex: 1; display: grid; place-items: center; }
.tm-ho-pic img { display: block; max-width: calc(100vw - 60px); max-height: calc(100vh - 130px); object-fit: contain; border-radius: 6px; }
.tm-ho-box > .fine { margin: 0 4px; font-size: 12px; color: var(--faint); }
.tm-ho-prev { display: block; max-width: 100%; max-height: 180px; margin: 0 auto; border-radius: 6px; }
.tm-ho-who { display: grid; gap: 4px; padding-left: 24px; }
.tm-ho.on { border-color: var(--gold); color: var(--gold2); }

/* Step 7: spell templates, pop-outs */
.tm-ft { font: 700 12px/1 var(--sans); flex-direction: column; gap: 1px; }
.tm-ft small { font-size: 9px; color: var(--muted); }
.tm-sizes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.tm-sizes button { padding: 6px 0; border-radius: 7px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); font: 600 12px var(--sans); cursor: pointer; }
.tm-sizes button.on { border-color: var(--gold); color: var(--gold2); background: var(--hover2); }

/* Step 8: sight reveals */
.tm-seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.tm-seg button { padding: 5px 10px; border: 0; background: var(--bg2); color: var(--text); font: 600 12px var(--sans); cursor: pointer; }
.tm-seg button + button { border-left: 1px solid var(--line2); }
.tm-seg button.on { background: var(--gold-dim); color: #fff; }

/* Phones: the map, and the page full screen when asked for */
@media (max-width: 759px) {
  .tbl-resize { display: none !important; }
  .tbl-dock { position: fixed; inset: 0; z-index: 31; width: auto; display: none !important; }
  body.tbl-page-on .tbl-dock { display: flex !important; }
  .tbl-back { display: block; flex: none; height: 42px; width: 100%; border: 0; border-bottom: 1px solid var(--line2);
    background: var(--panel); color: var(--gold2); font: 600 14px var(--sans); cursor: pointer; }
  .tm-name { max-width: 40vw; }
  .tm-b { height: 38px; }
  body.tbl-page-on .chat-fab { bottom: 84px; }
  .tm-tools { top: auto; bottom: 10px; left: 10px; right: 74px; flex-direction: row; overflow-x: auto; overflow-y: hidden; max-height: none; }
  .tm-sep { width: 1px; height: auto; margin: 4px 3px; }
  .tm-t { width: 38px; height: 38px; }
  .tm-hint { bottom: 160px; }
  .tm-align { bottom: 112px; }
  /* phones: the options are a row just above the zoom, which sits above the tools */
  .tm-opts { top: auto; left: 10px; right: 10px; bottom: 112px; flex-direction: row; overflow-x: auto; width: max-content; max-width: calc(100% - 20px); }
  .tm-turns { top: calc(var(--bar-b, 44px) + 10px); left: 8px; right: 8px; transform: none; max-width: none; }
  .tm-te { max-width: 110px; }
  .tm-lib { left: 8px; right: 8px; width: auto; top: calc(var(--bar-b, 44px) + 10px); bottom: 64px; }     /* above a sheet's bottom Roll bar, as on the sheet page */
}

/* The app inside the page column: no banner or footer, a little tighter */
html.docked .banner, html.docked .foot, html.docked #mapBtn { display: none !important; }

/* 2026-12-05: token looks and pictures, the monster library, turn order extras, split party, wall kinds */
.tm-menu .tm-row { display: flex; gap: 4px; }
.tm-menu .tm-row button { flex: 1; justify-content: center; font-size: 17px; padding: 6px; }
.tm-menu .tm-turn span { align-self: center; padding: 0 4px 0 10px; font-size: 14px; color: var(--muted); }
.tm-menu em.k { color: var(--faint); font-weight: 400; }   /* a keyboard shortcut: no use on a phone */
@media (pointer: coarse) { .tm-menu em.k { display: none; } }
.tm-more summary { padding: 8px 10px; border-radius: 8px; font: 500 14px var(--sans); color: var(--muted); cursor: pointer; list-style: none; }
.tm-more summary::-webkit-details-marker { display: none; }
.tm-more summary::after { content: ' ▸'; }
.tm-more[open] summary::after { content: ' ▾'; }
.tm-more summary:hover { background: var(--hover); }
.tm-more > button { width: 100%; padding-left: 20px; }
.tm-menu .tm-tsz button { padding: 6px 2px; min-width: 0; align-items: baseline; font-weight: 700; }   /* text sizes: A, growing; then B for bold */
.tm-menu .tm-row button.on { background: var(--hover2); color: var(--gold2); }
.tm-sides { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 4px 6px; }
.tm-menu .tm-sides button { padding: 2px; border: 2px solid transparent; border-radius: 50%; width: 42px; height: 42px; justify-content: center; }
.tm-menu .tm-sides button.on { border-color: var(--gold); }
.tm-sides img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.tm-looks { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.tm-looks summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.tm-looks[open] { display: flex; flex-direction: column; gap: 6px; }
.tm-looks input[type=color] { width: 40px; height: 30px; padding: 0; border: 0; background: none; }
/* 2026-12-06: frame, tint and aura rows in the token dialog; to the front / back in the token menu */
.tm-looks .tm-stats { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }   /* phone: frame and name on one line, tint below */
.tm-tint { display: flex; align-items: flex-end; gap: 6px; }
.tm-tint label.check { padding-bottom: 8px; }
.tm-aura { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--muted); font-size: 14.5px; }
.tm-aura > span { flex: none; min-width: 48px; }
dialog .form .tm-aura input[type=number] { width: 72px; }
dialog .form .tm-aura select { width: auto; }
dialog .form .tm-aura label.check, dialog .form .tm-tint label.check { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
dialog .form .tm-aura label.check input, dialog .form .tm-tint label.check input { width: auto; margin: 0; }
.tm-menu .tm-row.tm-order button { font-size: 13px; }
.tm-chk { display: flex; flex-direction: column; gap: 4px; max-height: 40vh; overflow: auto; }
.tm-best { width: min(420px, calc(100vw - 40px)); }
.tm-blist { display: flex; flex-direction: column; gap: 4px; max-height: 55vh; overflow: auto; }
.tm-bf { margin: 8px 0 2px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tm-bi { display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 8px; background: rgba(255, 255, 255, .03); }
.tm-bi img, .tm-bdot { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; display: grid; place-items: center; font: 700 13px Cinzel, serif; color: #fff; }
.tm-bn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tm-bn b, .tm-bn small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-bn small { color: var(--muted); font-size: 12px; }
.tm-bi .btn.small { min-width: 34px; padding: 4px 8px; }
.tm-te.del { opacity: .6; font-style: italic; }
.tm-te.cust { border-style: dotted; }
.tm-te small { font-size: 10px; color: var(--muted); margin-left: -2px; }
.tm-te i { font-style: normal; font-size: 11px; color: var(--gold2); }
.tm-wk { flex-direction: column; gap: 0; }
.tm-wk small { font-size: 9px; line-height: 1; }
/* map scale: so much per square, in a unit; quick presets */
.tm-scale { display: inline-flex; gap: 4px; }
.tm-scale input { width: 70px; }
.tm-scales { display: flex; flex-wrap: wrap; gap: 4px; }
.tm-scales .btn.small { padding: 3px 8px; font-size: 12px; }
/* zoom: − / percentage (click to fit) / + in the bottom corner, beside the tool column */
.tm-zoom { position: absolute; left: 66px; bottom: 12px; display: flex; align-items: stretch; z-index: 6; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line2); background: rgba(20, 16, 12, .88); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.tm-zoom[hidden] { display: none; }
.tm-zoom button { min-width: 36px; height: 36px; padding: 0 8px; border: 0; background: none; color: var(--text); font: 600 18px Inter, sans-serif; cursor: pointer; }
.tm-zoom button + button { border-left: 1px solid var(--line); }
.tm-zoom .tm-zl { min-width: 58px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tm-zoom button:hover { background: var(--hover); color: #fff; }
.tbl-map button { touch-action: manipulation; }   /* quick taps on + or − mustn't zoom the whole page on a phone */
.tm-zoom .tm-wh { min-width: 30px; padding: 0 7px; color: var(--muted); display: flex; align-items: center; }
@media (hover: none) and (pointer: coarse) { .tm-zoom .tm-wh { display: none; } }   /* a wheel setting means nothing on a touch screen */
@media (max-width: 759px) {
  /* the tools are a row along the bottom here: the zoom sits just above them */
  .tm-zoom { left: 10px; bottom: 66px; }
}
/* condition extras: a number and rounds left for each condition that's on */
.tm-mkx:empty { display: none; }
.tm-mkx { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; padding-top: 6px; border-top: 1px solid var(--line2); }
.tm-mkrow { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tm-mkrow span { margin-right: auto; }
.tm-mkrow label { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.tm-mkrow input { width: 52px; }
/* the GM's maps menu: thumbnails and folders */
.tm-maps .tm-mapi { display: flex; align-items: center; gap: 8px; }
.tm-maps .tm-mapi img, .tm-maps .tm-nothumb { flex: none; width: 34px; height: 24px; border-radius: 4px; object-fit: cover; background: #2a241d; box-shadow: 0 0 0 1px var(--line2); }
.tm-maps .tm-mapi span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-mapf summary { cursor: pointer; padding: 6px 10px; font-size: 13px; color: var(--muted); list-style: none; }
.tm-mapf summary::-webkit-details-marker { display: none; }
.tm-mapf summary small { opacity: .7; }
.tm-mapf[open] summary { color: var(--text, #eee); }
.tm-mapf .tm-mapi { padding-left: 20px; }
.tm-gone { border-top: 1px solid var(--line); margin-top: 4px; }
.tm-gone summary { cursor: pointer; padding: 8px 10px 6px; font-size: 13px; color: var(--muted); list-style: none; }
.tm-gone summary::-webkit-details-marker { display: none; }
.tm-gone summary small { opacity: .7; }
.tm-goner { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 6px 3px 20px; font-size: 13px; color: var(--muted); }
.tm-goner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-menu .tm-goner button { flex: none; padding: 4px 10px; border: 1px solid var(--line2); font-size: 12px; color: var(--gold2); }
/* Z: a token's picture, large */
.tm-zoom { padding: 0; border: 0; background: none; max-width: 92vw; max-height: 92vh; text-align: center; cursor: zoom-out; }
.tm-zoom::backdrop { background: rgba(0, 0, 0, .8); }
.tm-zoom img { display: block; max-width: 90vw; max-height: 84vh; margin: 0 auto; border-radius: 10px; box-shadow: 0 8px 40px rgba(0, 0, 0, .6); }
.tm-zoom p { margin: 8px 0 0; color: #fff; font: 600 16px var(--sans); }

/* a1 (2026-12-06): the hover card on a token, the Find list, the GM's own conditions */
.tm-tip { position: absolute; z-index: 6; max-width: 260px; padding: 7px 10px; border-radius: 9px; background: rgba(20, 16, 12, .94); border: 1px solid var(--line2);
  box-shadow: var(--shadow); color: var(--text); font: 13px/1.35 var(--sans); pointer-events: none; display: grid; gap: 4px; }
.tm-tip b { font-size: 14px; }
.tm-tiphp { color: #9fe0a0; font-weight: 600; }
.tm-tiphp.down { color: var(--down); }
.tm-tiphp small { color: #7fd3ff; }
.tm-tipms { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.tm-tipm { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tm-tipm i { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font: 700 8.5px var(--sans); font-style: normal; color: #fff; box-shadow: 0 0 0 1px #000; }
.tm-tipm small { color: var(--muted); }
.tm-findm { min-width: 220px; }
.tm-findm .tm-fq { margin: 2px 6px 6px; }
.tm-flist { display: grid; max-height: 46vh; overflow-y: auto; }
.tm-flist span { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-fdot { flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 1px #000; }
.tm-ownb { justify-self: start; }
.tm-ownlist { display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; margin-bottom: 10px; }
.tm-ownrow { display: flex; gap: 6px; align-items: center; }
.tm-ownrow input:first-child { flex: 1; min-width: 0; }
.tm-ownrow .tm-owns { width: 52px; text-align: center; }
.tm-ownrow input[type=color] { width: 40px; height: 34px; padding: 2px; }

/* The grid panel in sections that fold: Grid, Scale, Page; then the defaults for new maps (2026-12-06) */
.tm-gridp { display: grid; gap: 4px; width: 316px; max-width: 100%; }
.tm-sec { border-top: 1px solid var(--line); }
.tm-sec summary { cursor: pointer; padding: 8px 10px 6px; font: 700 13px var(--sans); color: var(--gold2); list-style: none; display: flex; align-items: center; gap: 6px; }
.tm-sec summary::-webkit-details-marker { display: none; }
.tm-sec summary::before { content: '▸'; color: var(--muted); font-size: 11px; transition: transform .15s; }
.tm-sec[open] summary::before { transform: rotate(90deg); }
.tm-sec .tm-panel { padding: 2px 10px 10px; }
.tm-scale input[type=range] { width: 110px; }
.tm-alpha { min-width: 36px; text-align: right; color: var(--muted); font-size: 12px; }
.tm-gdef { border-top: 1px solid var(--line); padding: 10px 10px 4px; display: grid; gap: 6px; justify-items: start; }
.tm-gdef .fine { margin: 0; }
