/* ScoutTract dashboard mode (app-mode.js). S2 accents: navy #1F2A44, copper #B87333. */
body.dm-hunting [data-dm="land"]:not([data-dm-force]), body.dm-land [data-dm="hunt"]:not([data-dm-force]) { display: none !important; }
/* modes registry (config/modes.json): rows / More buttons not in the active modes; "Show all" lifts it */
body.dm-on [data-dm-off]:not([data-dm-force]) { display: none !important; }

.dm-chip { position: relative; display: inline-flex; }
.dm-chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 15px; cursor: pointer;
  border: 1px solid #B87333; background: #1F2A44; color: #fff; font: 600 12px/1 system-ui, sans-serif; white-space: nowrap; }
.dm-chip-btn:hover, .dm-chip-btn[aria-expanded="true"] { background: #2a3858; }
.dm-chip-btn:focus-visible { outline: 2px solid #B87333; outline-offset: 2px; }
.dm-car { opacity: .7; font-size: 10px; }
.dm-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 4000; width: 300px; padding: 6px; border-radius: 10px;
  background: #fff; color: #1F2A44; box-shadow: 0 10px 30px rgba(0,0,0,.28); border-top: 3px solid #B87333; }
.dm-menu-h { font: 700 11px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; padding: 6px 8px 8px; }
.dm-menu button { display: flex; gap: 10px; width: 100%; text-align: left; padding: 8px; border: 0; border-radius: 8px; background: none; color: inherit; cursor: pointer; font: inherit; }
.dm-menu button:hover, .dm-menu button:focus-visible { background: #f3ede7; outline: none; }
.dm-menu button[aria-checked="true"] { background: #1F2A44; color: #fff; }
.dm-menu button[aria-checked="true"] small { color: #d7dbe4; }
.dm-menu b, .dm-opt b, .dm-card b { display: block; font-size: 13px; }
.dm-menu small, .dm-opt small, .dm-card small { display: block; font-size: 11.5px; line-height: 1.35; color: #5b6472; margin-top: 2px; }
.dm-ico { font-size: 18px; line-height: 1.1; }

.dm-settings .dm-opts { display: grid; gap: 8px; margin-top: 8px; }
.dm-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid #d6d9df; border-radius: 10px; cursor: pointer; }
.dm-opt.on { border-color: #B87333; box-shadow: inset 0 0 0 1px #B87333; background: rgba(184,115,51,.07); }
.dm-opt input { margin-top: 3px; accent-color: #B87333; }

.dm-dialog { border: 0; padding: 0; border-radius: 14px; width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; color: #1F2A44; background: #fff; box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.dm-dialog::backdrop { background: rgba(15,22,38,.55); }
.dm-dlg header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; border-top: 4px solid #B87333; }
.dm-dlg h3 { margin: 0; font-size: 18px; color: #1F2A44; }
.dm-x { border: 0; background: none; font-size: 16px; cursor: pointer; color: #6b7280; padding: 4px 8px; }
.dm-sub { margin: 0; padding: 0 18px 12px; font-size: 13px; color: #4b5563; }
.dm-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 18px 16px; }
.dm-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid #d6d9df; background: #f8f9fb; color: #1F2A44; font: inherit; }
.dm-card .dm-ico { font-size: 26px; }
.dm-card:hover, .dm-card:focus-visible { border-color: #B87333; outline: none; background: #fff; }
.dm-card.on { border-color: #B87333; box-shadow: inset 0 0 0 1px #B87333; background: rgba(184,115,51,.08); }
.dm-foot { padding: 0 18px 16px; text-align: right; }
.dm-toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 5000; transition: .2s;
  background: #1F2A44; color: #fff; padding: 9px 14px; border-radius: 18px; font: 600 13px/1.2 system-ui, sans-serif; border: 1px solid #B87333; max-width: calc(100vw - 32px); }
.dm-toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .dm-cards { grid-template-columns: 1fr; }
  .dm-card { flex-direction: row; align-items: center; gap: 12px; padding: 12px; }
  .dm-card b { min-width: 110px; }
  .dm-menu { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; border-radius: 14px 14px 0 0; padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); }
  .dm-dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 14px 14px 0 0; }
}
/* Phones (<=760px): the switch is pinned in the top bar (app-mode.js placeChip) as a full button with a 40px
   tap target; the logo text and the icon row give way first. Desktop styles above are untouched. */
@media (max-width: 760px) {
  .topbar > .dm-chip-pinned { flex: 0 0 auto; order: 0; margin-left: auto; position: relative; z-index: 2; }
  .topbar > .dm-chip-pinned .dm-chip-btn { height: 40px; min-width: 40px; padding: 0 12px; gap: 6px; border-radius: 20px;
    font: 700 14px/1 system-ui, sans-serif; border-width: 1.5px; box-shadow: 0 1px 0 rgba(0,0,0,.25); touch-action: manipulation; }
  .topbar > .dm-chip-pinned .dm-ico { font-size: 18px; }
  .topbar > .dm-chip-pinned .dm-car { font-size: 12px; opacity: .9; }
  .topbar > .dm-chip-pinned .dm-lbl { max-width: none; }
  .topbar:has(> .dm-chip-pinned) .brand { flex: 0 1000 auto; min-width: 0; overflow: hidden; }
  .topbar:has(> .dm-chip-pinned) .brand b, .topbar:has(> .dm-chip-pinned) .brand span { overflow: hidden; text-overflow: ellipsis; }
  .topbar:has(> .dm-chip-pinned) .top-actions { flex: 0 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .topbar:has(> .dm-chip-pinned) .top-actions::-webkit-scrollbar { display: none; }
  .topbar:has(> .dm-chip-pinned) .top-actions > * { flex-shrink: 0; }
  .topbar:has(> .dm-chip-pinned) > .ga-pwa-actions { flex: 0 1 auto; min-width: 0; overflow: hidden; }
  /* the open menu is a bottom sheet: lift the top bar's stacking context above the phone bottom nav */
  .topbar:has(> .dm-chip-pinned #dmMenu:not([hidden])) { z-index: 9500; }
}
@media (max-width: 360px) {
  .topbar > .dm-chip-pinned .dm-chip-btn { padding: 0 10px; gap: 5px; font-size: 13.5px; }
}
/* Settings card lives in the dark Settings pane: beat the generic .records-card label/input rules */
#dmSettingsCard label.dm-opt { display: flex; margin: 0; color: var(--text, #eaf1f6); border-color: #324c60; background: #0e1f2e; }
#dmSettingsCard label.dm-opt.on { border-color: #B87333; background: rgba(184,115,51,.14); }
#dmSettingsCard .dm-opt input[type=radio] { width: auto; margin: 3px 0 0; padding: 0; flex: none; }
#dmSettingsCard .dm-opt small { color: var(--muted, #93a9bc); }
#dmSettingsCard .dm-opts { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
/* Modules can declare where they belong: data-app-modes="hunting land everything" (e.g. Weather launchers) */
body.dm-hunting [data-app-modes]:not([data-app-modes~="hunting"]):not([data-dm-force]),
body.dm-land [data-app-modes]:not([data-app-modes~="land"]):not([data-dm-force]),
body:not(.dm-hunting):not(.dm-land) [data-app-modes]:not([data-app-modes~="everything"]):not([data-dm-force]) { display: none !important; }
/* Hunting: simpler Map tools heading in place of the "Geographic workspace" research header */
.dm-map-title { font-size: 13px; font-weight: 680; }
.dm-map-title small { display: block; color: var(--muted, #93a9bc); font-weight: 400; font-size: 10px; margin-top: 3px; }

/* ---- modes (2026-11-03): picture icons, combine (✓), favorites, Modes & layout editor ---- */
.dm-img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; vertical-align: middle; display: inline-block; background: #1F2A44; }
.dm-chip-btn .dm-ico { display: inline-flex; gap: 2px; }
.dm-chip-btn .dm-img { width: 20px; height: 20px; box-shadow: 0 0 0 1px #B87333; }
.dm-chip-btn .dm-img + .dm-img { margin-left: -7px; }
.dm-img-lg { width: 30px; height: 30px; }
.dm-img-xl { width: 44px; height: 44px; }
.dm-menu { max-height: min(78vh, 640px); overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 761px) { .dm-menu { width: 330px; } }
@media (max-width: 760px) { .dm-menu { z-index: 9600; max-height: 80vh; } .dm-menu .dm-row > button[data-mode] small { font-size: 11px; }
  .dm-dialog.dm-editor { width: 100vw; max-width: 100vw; max-height: 92vh; overflow-y: auto; } }
.dm-menu-h span { text-transform: none; letter-spacing: 0; font-weight: 500; }
.dm-row { display: flex; align-items: stretch; gap: 4px; }
.dm-row > button[data-mode] { flex: 1 1 auto; min-width: 0; }
.dm-menu .dm-row .dm-img { width: 28px; height: 28px; }
.dm-menu button.dm-add, .dm-card-w .dm-add { flex: 0 0 40px; width: 40px; justify-content: center; align-items: center; font: 700 17px/1 system-ui, sans-serif; border: 1px solid #d6d9df; border-radius: 8px; background: #fff; color: #1F2A44; cursor: pointer; }
.dm-menu button.dm-add.on, .dm-card-w .dm-add.on { background: #B87333; border-color: #B87333; color: #fff; }
.dm-menu-f { border-top: 1px solid #e5e7eb; margin-top: 4px; padding-top: 4px; }
.dm-menu-f button { font-size: 12.5px; padding: 9px 8px; color: #1F2A44; }
.dm-menu-f button[aria-pressed="true"] { color: #B87333; font-weight: 700; }
.dm-cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.dm-card-w { position: relative; display: flex; }
.dm-card-w .dm-card { flex: 1 1 auto; }
.dm-card-w .dm-add { position: absolute; top: 8px; right: 8px; height: 32px; width: 32px; }
.dm-extra { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; }
.dm-extra select { width: auto; }
.dm-set-actions { margin-top: 10px; }
/* favorites (☆ in the editor): first in their list, copper star */
[data-dm-fav] { order: -1; }
.hunt-cats:has(> [data-dm-fav]) { display: flex; flex-direction: column; }
details[data-dm-fav] > summary::after, .lp-group[data-dm-fav] > details > summary::after { content: " ★"; color: #B87333; }
.st-more-item[data-dm-fav], .rail-tab[data-dm-fav], .stw-mb[data-dm-fav] { box-shadow: inset 0 -2px 0 #B87333; }
/* Modes & layout editor */
.dm-editor { width: min(760px, calc(100vw - 24px)); }
.dm-ed-modes { display: flex; gap: 6px; overflow-x: auto; padding: 0 18px 10px; scrollbar-width: thin; }
.dm-ed-modes button { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; padding: 6px 8px; border: 1px solid #d6d9df; border-radius: 10px; background: #f8f9fb; color: #1F2A44; font: 600 11.5px/1.1 system-ui, sans-serif; cursor: pointer; }
.dm-ed-modes button .dm-img { width: 30px; height: 30px; }
.dm-ed-modes button.act { box-shadow: inset 0 -3px 0 #B87333; }
.dm-ed-modes button[aria-selected="true"] { background: #1F2A44; color: #fff; border-color: #1F2A44; }
.dm-ed-modes .dm-ed-newb { justify-content: center; border-style: dashed; }
.dm-ed-head { display: flex; gap: 10px; align-items: center; padding: 0 18px 8px; }
.dm-ed-head small { display: block; color: #5b6472; font-size: 12px; }
.dm-pill { font-size: 10.5px; background: #B87333; color: #fff; border-radius: 8px; padding: 1px 6px; vertical-align: middle; }
.dm-ed-tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid #e5e7eb; }
.dm-ed-tabs button { border: 0; background: none; padding: 8px 12px; font: 600 13px system-ui, sans-serif; color: #5b6472; cursor: pointer; border-bottom: 3px solid transparent; }
.dm-ed-tabs button[aria-selected="true"] { color: #1F2A44; border-bottom-color: #B87333; }
.dm-ed-note { margin: 8px 18px 0; font-size: 12.5px; color: #4b5563; }
.dm-ed-list { list-style: none; margin: 6px 0 0; padding: 0 18px; max-height: min(46vh, 420px); overflow-y: auto; }
.dm-ed-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid #f0f1f4; }
.dm-ed-row.off .dm-ed-l b { color: #8a93a3; font-weight: 500; }
.dm-ed-row.na { opacity: .55; }
.dm-eye, .dm-star { flex: 0 0 38px; height: 38px; border: 1px solid #d6d9df; border-radius: 8px; background: #fff; cursor: pointer; font-size: 17px; color: #1F2A44; }
.dm-eye[aria-pressed="false"] { color: #9aa3b2; }
.dm-star.on { color: #B87333; border-color: #B87333; }
.dm-eye:disabled, .dm-star:disabled { cursor: default; opacity: .5; }
.dm-ed-l { min-width: 0; }
.dm-ed-l b { display: block; font-size: 13px; }
.dm-ed-l small { display: block; font-size: 11px; color: #6b7280; }
.dm-ed-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 18px 16px; }
.dm-ed-hint { margin-left: auto; font-size: 11.5px; color: #6b7280; }
.dm-danger { color: #b42318 !important; }
.dm-ed-new { padding: 4px 18px 0; display: grid; gap: 8px; }
.dm-ed-new h4 { margin: 0; }
.dm-ed-new label { display: grid; gap: 4px; font-size: 13px; }
.dm-ed-new input[type=text], .dm-ed-new select { padding: 8px; border: 1px solid #c9ced8; border-radius: 8px; font: inherit; }
.dm-ed-lbl { font-size: 13px; }
.dm-pics { display: flex; flex-wrap: wrap; gap: 6px; }
.dm-pic { display: inline-flex !important; align-items: center; justify-content: center; width: 46px; height: 46px; border: 2px solid transparent; border-radius: 50%; cursor: pointer; }
.dm-pic input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dm-pic.on { border-color: #B87333; }
.dm-upload { width: auto !important; border-radius: 10px; border: 1px dashed #9aa3b2; padding: 0 10px; font-size: 12px; }
.dm-ed-err { color: #b42318; font-size: 12.5px; }
@media (max-width: 820px) {
  .dm-card-w .dm-add { top: 50%; transform: translateY(-50%); }
  .dm-card-w .dm-card { padding-right: 52px; }
  .dm-editor .dm-ed-list { max-height: 44vh; }
}
/* short screens (phone landscape / small tablets): the mode menu is a fixed scrolling panel above the map */
.topbar:has(#dmMenu:not([hidden])) { z-index: 9500; }
@media (max-height: 560px) {
  .dm-menu { position: fixed; top: 6px; right: 6px; bottom: 6px; left: auto; width: min(420px, calc(100vw - 12px)); max-height: none; z-index: 9600; border-radius: 12px; }
  .dm-dialog.dm-editor { max-height: 96vh; overflow-y: auto; }
  .dm-editor .dm-ed-list { max-height: none; }
}

/* V2 membership checklists: checkbox and label remain one keyboard/touch target. */
.dm-ed-row .dm-ed-l{display:block;cursor:pointer;padding:8px}.dm-ed-l input[type=checkbox]{width:20px;height:20px;vertical-align:middle;margin-right:8px}.dm-ed-l small{margin-left:32px}
