/* Compact target actions: one row per action, no nested cards or explanatory wall. */
.cmd-menu.target-action-menu.combat-command {width:300px;max-width:calc(100vw - 20px);padding:12px;gap:8px;border-radius:12px;}
.combat-command .cmd-menu-head {padding:0 0 6px;border-bottom:1px solid #ced7c4;}
.combat-target-head {display:flex;align-items:center;gap:10px;margin:4px 0 8px;}
.combat-target-art {display:grid;place-items:center;width:40px;height:40px;flex:none;}
.combat-target-art .monster-asset {width:36px;height:36px;}
.combat-target-title {display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.combat-target-title small {color:#71816c;}
.combat-target-health {height:5px;background:#d2dac9;border-radius:4px;margin:6px 0 3px;overflow:hidden;}
.combat-target-health i {display:block;height:100%;background:#77996a;}
.combat-target-caption {color:#71816c;font-variant-numeric:tabular-nums;}
.combat-command .target-action-list {gap:3px;}
.combat-command .target-action-row {display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:5px!important;padding:6px 0!important;border:0;background:none!important;box-shadow:none;}
.combat-command .target-action-label {grid-column:auto;white-space:nowrap;}
.combat-command .target-action-mode {min-width:48px;white-space:nowrap;}
.combat-command .target-action-mode.immediate {background:#597b51!important;color:#fff!important;border-color:#597b51;}
.combat-command .combat-cost-note {margin:6px 0 0;color:#7b866e;font-size:10px!important;}
.combat-affinity {font-size:10px!important;color:color-mix(in srgb,var(--skill-color) 35%,#28432d);border:1px solid currentColor;border-radius:4px;padding:0 4px;}
/* The result has its own column even when the action or actor has a long name. */
.log-scope {display:flex;align-items:center;gap:3px;align-self:flex-start;padding:2px;border-radius:7px;background:#e4e8db;}
#mobilePanelDrawer .log-scope button {padding:4px 14px;border:0;border-radius:5px;background:transparent;color:#516049;cursor:pointer;}
#mobilePanelDrawer .log-scope button[aria-pressed="true"] {background:#405a43;color:#fff;}
#messages {display:block;min-width:0;min-height:0;max-height:none;flex:1 1 auto;overflow:auto;overscroll-behavior:contain;padding:0;scrollbar-width:thin;}
#messages .log-group {display:block;min-width:0;margin:0 0 6px;padding:0;border:0;border-radius:6px;background:#f7f8f0!important;box-shadow:none;}
#messages .log-group-head {padding:7px 8px;gap:8px;justify-content:flex-start;background:#e5eadf!important;color:#38553e;}
#messages .log-group-head span {color:#556851;font-variant-numeric:tabular-nums;}
#messages .log-entry {min-width:0;margin:0;border-bottom:1px solid #dce2d5;}
#messages .log-entry > summary {display:flex;align-items:baseline;gap:6px;min-width:0;min-height:32px;box-sizing:border-box;padding:6px 5px;list-style:none;cursor:pointer;line-height:1.5;color:#2e4033;}
#messages .log-entry > summary::-webkit-details-marker {display:none;}
#messages .log-entry > summary::after {content:'';align-self:center;width:4px;height:4px;flex:none;border-right:1px solid #64765f;border-bottom:1px solid #64765f;transform:rotate(-45deg);margin:0 2px;}
#messages .log-entry[open] > summary::after {transform:rotate(45deg);}
#messages .log-entry > summary:hover,#messages .log-entry[open] > summary {background:#edf1e5;}
#messages summary:focus-visible,.log-scope button:focus-visible {outline:2px solid #517650;outline-offset:-2px;}
#messages .log-time {flex:none;color:#53644f;font:11px/1.5 system-ui,sans-serif;font-variant-numeric:tabular-nums;}
#messages .log-actor,#messages .log-action,#messages .log-note {min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#messages .log-actor {flex:0 0 auto;max-width:18%;color:#284c37;font-weight:700;}
#messages .log-action {flex:1 1 0;}
#mobilePanelDrawer #messages :is(.log-action,.log-actor,.log-result) {font-size:13px!important;}
#messages .log-note {flex:0 1 auto;max-width:21%;color:#685a3e;}
#messages .log-result {flex:none;white-space:nowrap;font-weight:750;color:#51604e;font-variant-numeric:tabular-nums;}
#messages .log-result[data-tone=damage] {color:#933b30;}
#messages .log-result[data-tone=heal] {color:#22683c;}
#messages .log-result[data-tone=reward] {color:#825718;}
#messages .log-details {padding:8px 9px;border-left:2px solid #a3b49b;background:#f0f3e9;color:#405441;}
#messages .log-detail-head {display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between;gap:4px;color:#54644f;}
#messages .log-detail-head button {padding:2px 5px;color:#355b41;cursor:pointer;}
#messages .log-detail-result {margin:4px 0;font-weight:650;}
#messages .log-original {margin:4px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55;}
.skill-quality {color:var(--quality-color);border:1px solid currentColor;padding:0 4px;border-radius:4px;white-space:nowrap;}
.ability[data-skill-id] {border-left:2px solid var(--quality-color)!important;padding-left:8px!important;}
.ability-element {color:var(--skill-color);}
@media(max-width:900px){.cmd-menu.target-action-menu.combat-command {max-height:min(60dvh,360px);overflow:auto;}}

/* The outer frame owns the map anchor and tip. Only the card scrolls. */
.map-target-popover {position:fixed;z-index:9999;isolation:isolate;}
.map-target-popover:not([data-placement]) {visibility:hidden;}
.map-target-popover > .cmd-menu.target-action-menu {
  position:relative;inset:auto!important;transform:none;margin:0;width:100%;min-width:0;max-width:none;
  box-sizing:border-box;overflow:auto;overscroll-behavior:contain;border-radius:12px;
  background:#f0f3e7!important;border:1px solid #bac9b2!important;
}
.map-target-popover::before {
  content:"";position:absolute;width:12px;height:12px;background:#f0f3e7;
  border:1px solid #bac9b2;transform:translate(-50%,-50%) rotate(45deg);z-index:-1;
}
.map-target-popover[data-placement="below"]::before {left:var(--tip);top:0;}
.map-target-popover[data-placement="above"]::before {left:var(--tip);top:100%;}
.map-target-popover[data-placement="left"]::before {left:100%;top:var(--tip);}
.map-target-popover[data-placement="right"]::before {left:0;top:var(--tip);}
.map-target-popover .combat-command .target-action-list {padding:0;}
.map-target-popover .combat-command .cmd-menu-head {background:transparent!important;border-radius:0;box-shadow:none;}
.combat-command .combat-cost-note,.combat-command .combat-skill-help {color:#4c6249;}
.world .pet-avatar .action-bubble {top:auto;bottom:calc(100% + 5px);left:50%;text-align:center;}
.world:not(.hide-names) .pet-avatar .action-bubble {bottom:calc(100% + 21px);}
.world.hide-bubbles .pet-avatar .action-bubble {display:none;}
.world .world-monster.command-target .monster-tooltip {visibility:hidden;opacity:0;}

.help-matchups {margin:8px 0 14px;}
.help-matchups summary {cursor:pointer;font-weight:650;color:#314f3a;}
.help-matchups table {width:100%;border-collapse:collapse;margin-top:6px;color:#304738;}
.help-matchups th,.help-matchups td {padding:4px 8px;text-align:left;border-bottom:1px solid #cdd7c3;}
.help-matchups thead {background:#e3eadb;}

/* Map actions share the forest palette and iconography used by the world HUD. */
.cmd-menu.target-action-menu, .map-target-popover > .cmd-menu.target-action-menu, #objActionPopup {
  --map-ink:#25493a; --map-gold:#a77c40;
  box-sizing:border-box; padding:12px; color:var(--map-ink);
  background:linear-gradient(145deg,#faf7eb,#eef0df)!important;
  border:1px solid #c6c8ab!important; border-radius:17px;
  box-shadow:0 8px 24px #17372636,0 2px 5px #17372625;
}
.cmd-menu.target-action-menu {overflow:auto;overscroll-behavior:contain;}
.cmd-menu.target-action-menu .cmd-menu-head, #objActionPopup .obj-action-header {
  display:flex; align-items:center; justify-content:flex-start; gap:8px;
  margin:-12px -12px 9px; padding:8px 12px; min-height:29px;
  border:0!important; border-radius:0; box-shadow:none!important;
  background:linear-gradient(105deg,#234c3c,#375a45)!important; color:#fff8da!important;
}
.cmd-menu.target-action-menu .cmd-menu-head b,#objActionTitle {color:#fff8da!important;letter-spacing:.06em;}
.command-seal {display:grid;place-items:center;width:26px;height:26px;border-radius:50%;color:#ffe3a0;border:1px solid #d3bd7a80;}
.command-seal .ui-icon {width:15px;height:15px;}
.cmd-menu.target-action-menu .cmd-menu-close,#objActionPopup #objActionCloseBtn {
  display:grid;place-items:center;margin-left:auto;color:#fff7db!important;background:#ffffff14!important;
  border:0!important;border-radius:50%;width:30px;height:30px;padding:5px;box-shadow:none!important;
}
.target-action-menu .target-detail-card,.target-action-menu .map-location-summary {
  margin:0;padding:3px 0 9px;background:none!important;border:0!important;box-shadow:none!important;
}
.target-action-menu .target-detail-meta {gap:4px 8px;}
.target-action-menu .target-detail-chip {padding:0;border:0;background:none!important;color:#516450;}
.cmd-menu.target-action-menu .target-action-list {padding:0;gap:0;}
.cmd-menu.target-action-menu .target-action-row {
  grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:5px!important;
  padding:8px 0!important;margin:0;border:0!important;border-top:1px solid #70845e30!important;
  background:transparent!important;border-radius:0;box-shadow:none!important;
}
.cmd-menu.target-action-menu .target-action-label {grid-column:auto;white-space:normal;line-height:1.3;font-weight:650;}
.service-price {display:flex;align-items:center;gap:3px;color:#785a28;font-weight:500;}
.service-price .ui-icon {width:12px;height:12px;}
.cmd-menu.target-action-menu .target-action-mode,#objActionPopup .obj-btn {
  padding:4px 9px;border-radius:16px;border:0!important;background:#e3e8d6!important;color:#334d3a!important;box-shadow:none!important;
}
.cmd-menu.target-action-menu .target-action-mode.immediate,#objActionPopup #objUpgradeBtn {background:#345c46!important;color:#fff9df!important;}
#objActionPopup #objDestroyBtn {color:#89483d!important;}
.cmd-menu.target-action-menu button:disabled {opacity:.47;cursor:not-allowed;}
.cmd-menu.target-action-menu .combat-target-head {margin:0;padding:0 0 8px;}
.combat-target-art {border-radius:50%;background:radial-gradient(ellipse,#e2dab4,transparent 72%);}
.cmd-menu.target-action-menu .combat-affinity {border:0;border-radius:12px;background:color-mix(in srgb,var(--skill-color) 34%,#f4f2e4);padding:1px 7px;}
.combat-skill-picker {grid-column:1/-1;min-width:0;margin:4px 0 0;padding:0;border:0;}
.combat-skill-picker legend {padding:0;margin-bottom:5px;color:#596c52;font-size:11px;}
.move-options {display:flex;flex-wrap:wrap;gap:5px;}
.move-token {position:relative;cursor:pointer;max-width:100%;}
.move-token input {position:absolute;width:1px;height:1px;opacity:0;}
.move-face {min-height:28px;box-sizing:border-box;display:inline-flex;align-items:center;gap:4px;padding:3px 8px;
  border-radius:16px;background:#e4e8d6;color:#39513d;border:1px solid transparent;}
.move-face svg {width:15px;height:15px;flex:none;}
.move-face .skill-glyph {position:static;stroke:currentColor;stroke-width:3px;fill:none;}
.move-face .skill-orbit {display:none;}
.move-face .skill-silhouette {fill:var(--element);stroke:currentColor;animation:none;}
.move-token input:checked + .move-face {background:#365c46;color:#fff8df;border-color:#365c46;}
.move-token input:focus-visible + .move-face,.target-action-menu button:focus-visible {outline:2px solid #a47228;outline-offset:2px;}
.combat-skill-help {display:block;margin:6px 0 0;line-height:1.45;color:#4f664d;overflow-wrap:anywhere;}
.combat-skill-help.unavailable {color:#88512c;}
.cmd-menu.map-quick-menu .target-action-list {gap:6px;}
.cmd-menu.map-quick-menu .map-quick-action {border:0;border-radius:12px;background:#e4ead8!important;color:#34533c;}
.map-target-popover::before {background:#eef0df;border-color:#c6c8ab;}
.map-target-popover[data-placement="below"]::before {background:#315440;}
@media (hover:hover) {
  .move-token:hover .move-face,.target-action-menu button:enabled:hover,#objActionPopup button:hover {filter:brightness(.95);}
}
.target-action-menu .target-detail-card:has(.map-detail-art) {display:flex;align-items:center;gap:9px;}
.map-detail-art {display:grid;place-items:center;flex:none;width:40px;height:40px;}
.map-detail-art > * {width:100%;height:100%;object-fit:contain;}
.target-action-menu .service-price {white-space:nowrap;}

.capture-panel {position:absolute;z-index:35;inset:12px auto auto 12px;width:min(300px,calc(100% - 24px));max-height:85%;overflow:auto;color:#403624;background:#fff9e9;border:1px solid #ad936a;border-radius:10px;box-shadow:0 4px 16px #372b2340;padding:12px;}
.capture-panel[hidden] {display:none;}
.capture-panel section+section {border-top:1px solid #d9c7aa;padding-top:.75rem;margin-top:.75rem;}
.capture-panel header,.capture-choices,.capture-panel label {display:flex;align-items:center;justify-content:space-between;gap:.5rem;}
.capture-panel header {margin-bottom:.6rem;}
.capture-panel select {min-width:0;max-width:72%;}
.capture-panel p {margin:.3rem 0;font-size:.85rem;}
.capture-panel time,.capture-panel small {font-size:.75rem;}
.capture-choices {justify-content:flex-start;margin-top:.6rem;}
.capture-choices button:disabled {opacity:.55;}
.pet-avatar:has(.suppressed-mark) .pet-sprite,.pet-avatar:has(.suppressed-mark) img {filter:grayscale(1);}
.suppressed-mark {position:absolute;z-index:3;bottom:0;white-space:nowrap;border-radius:.3em;background:#403d47;color:#fff;padding:.1em .35em;font-size:10px;}
.notoriety-mark {color:#815308;background:#ffe29a;border-radius:.25em;padding:0 .2em;}
.notoriety-mark.wanted,.log-result[data-tone=execution] {color:#8e1d28;}
.notoriety-mark.wanted {background:#f9d6d7;}
.pet-race-journal {display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:.4rem;}
.pet-race-journal div {padding:.4rem;border-bottom:1px solid #d9c7aa;}
.pet-race-journal dd {margin:0;font-size:.8rem;}
