/* The action panel (actionpanel.js, docs/specs/table-ui.md Decision 6). It lives in the card of #dock; colour, type and radius come from the theme tokens only. */
#c-res button.pill { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; min-height: 32px; font: inherit; font-size: 12px; color: inherit; background: transparent; }
#c-res button.pill[aria-expanded="true"] { border-color: var(--accent); }
#ap-how { border: 1px solid var(--accent); border-radius: var(--radius); padding: 8px 10px; font-size: 13px; background: var(--panel-2); }
#ap-how p { margin: 4px 0 0; color: var(--muted); } #ap-how .row { margin: 8px 0 0; } #ap-how button { min-height: 44px; }

#ap-body { min-height: 0; }
#ap-explore, #ap-attacks, #ap-spells, #ap-bonus, #ap-move, #ap-features, #ap-items, #ap-reactions, #ap-down { max-height: 132px; overflow-y: auto; overscroll-behavior: contain; }
#card[data-raised] :is(#ap-explore, #ap-attacks, #ap-spells, #ap-bonus, #ap-move, #ap-features, #ap-items, #ap-reactions, #ap-down) { max-height: max(132px, calc(55vh - 200px)); }
#card[data-collapsed] #ap-body { display: none; }
.ap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ap-list { display: grid; gap: 6px; margin-top: 6px; }
.ap-row { text-align: left; display: grid; align-content: center; gap: 1px; min-height: 48px; padding: 6px 10px; min-width: 0; }
.ap-row .ap-t { font-weight: 700; }
.ap-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ap-chip { flex: none; font-size: 11px; border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; color: var(--muted); }
.ap-row small.ap-pips { color: var(--ink); } .ap-pips .pips { letter-spacing: 1px; color: var(--accent); }
.ap-row.info { border: 1px dashed var(--line); border-radius: var(--radius); background: transparent; cursor: default; }
.ap-speed { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 13px; }
.ap-meter { flex: 1; height: 8px; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; } .ap-meter i { display: block; height: 100%; background: var(--accent); } .ap-row small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.ap-row small.ap-why { color: var(--ink); font-size: 12px; }
.ap-row.armed { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); } .ap-row.armed small { color: inherit; }
.ap-more { margin-top: 6px; } .ap-more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--muted); }
.ap-q { margin: 0 0 6px; font-weight: 700; color: var(--accent); } .ap-why-line { margin: 0 0 6px; }
#ap-reactions .rx { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; } #ap-reactions .rx select { min-height: 44px; }
#ap-reactions small { display: block; color: var(--muted); }

#ap-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
#ap-tabs button { flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 4px 6px; white-space: nowrap; }
#ap-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
#ap-tabs button.off { opacity: .5; }
#ap-tabs button#ap-grip { flex: none; min-width: 44px; background: transparent; }
#ap-tabs button.pulse { border-color: var(--accent); animation: ap-pulse .9s ease-in-out infinite alternate; }
@keyframes ap-pulse { to { background: var(--accent); color: var(--accent-ink); } }
@media (prefers-reduced-motion: reduce) { #ap-tabs button.pulse { animation: none; background: var(--accent); color: var(--accent-ink); } }

@media (min-width: 900px) {
  :is(#ap-explore, #ap-attacks, #ap-spells, #ap-bonus, #ap-move, #ap-features, #ap-items) .ap-list { grid-template-columns: 1fr 1fr; }
  #card[data-raised] :is(#ap-explore, #ap-attacks, #ap-spells, #ap-bonus, #ap-move, #ap-features, #ap-items, #ap-reactions, #ap-down) { max-height: max(184px, calc(40vh - 130px)); }
}

/* The card is a grid; its rows must not grow to the width of the bar of buttons, which scrolls sideways inside it. */
#card { grid-template-columns: minmax(0, 1fr); }
#ap-body, #ap-spells, #ap-items { min-width: 0; }

/* A greyed row keeps its reason at full strength: only the name and the numbers fade, so the words can be read without a hover. */
button.ap-row.off { opacity: 1; border-style: dashed; }
.ap-row.off .ap-top, .ap-row.off .ap-s, .ap-row.off .ap-pips { opacity: .55; }


/* Under a pane with more rows than fit: how many are below. */
#ap-cue { width: 100%; min-height: 28px; margin-top: 4px; padding: 0 8px; font-size: 12px; color: var(--muted); background: transparent; border-style: dashed; }

/* The Spells tab: the slot strip stays at the top of the pane whatever the sort or filters; the sort and filters and the groups scroll under it. */
#ap-spells { max-height: 176px; }
.ap-spellhead { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; margin: 0 0 6px; padding: 2px 6px; border-radius: var(--radius); background: var(--panel-2); }
.ap-slots { display: flex; flex-wrap: wrap; gap: 0 12px; font-size: 13px; }
.ap-slot .pips { letter-spacing: 1px; color: var(--accent); } .ap-slot.spent b { opacity: .6; }
.ap-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ap-tools label { display: flex; align-items: center; gap: 6px; font-size: 13px; } .ap-tools select { min-height: 44px; } .ap-tools button { min-height: 44px; }
.ap-filters { display: grid; gap: 4px; margin: 0 0 6px; }
.ap-fgroup { display: flex; flex-wrap: wrap; gap: 4px; }
button.ap-fchip { min-height: 44px; padding: 2px 12px; border-radius: 999px; font-size: 13px; }
button.ap-fchip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ap-head { margin: 8px 0 0; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ap-head:first-child { margin-top: 0; }
@media (min-width: 900px) { .ap-head { grid-column: 1 / -1; } #card[data-raised] #ap-spells { max-height: max(184px, calc(40vh - 130px)); } }

/* The Items tab: gear with its equip and attune buttons, and whom a potion is given to. */
.ap-row.ap-gear { border-style: solid; background: var(--panel-2); gap: 4px; }
.ap-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ap-acts button { min-height: 44px; padding: 4px 12px; }
.ap-acts button.off { border-style: dashed; opacity: .7; }
.ap-gear small.ap-why { color: var(--ink); font-size: 12px; }
.ap-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--accent); border-radius: var(--radius); }
.ap-pick span { font-size: 13px; color: var(--muted); }
.ap-pick button { min-height: 44px; padding: 4px 12px; }
@media (min-width: 900px) { .ap-pick { grid-column: 1 / -1; } }

/* The standing instructions that are not Reactions (#230): their own group under the Reactions. */
#ap-reactions .rx-group, #sheet-reactions .rx-group { margin-top: 10px; padding-top: 6px; border-top: 1px dashed var(--line); }
.rx-head { margin: 4px 0 2px; font-size: 14px; color: var(--muted); }
.rx-group .note { margin: 0 0 6px; }
/* E17: what lies on the ground in reach, a line for each thing with its own Pick up */
.ap-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ap-line button { min-height: 44px; padding: 4px 12px; }
.ap-line button.off { border-style: dashed; opacity: .7; }
.ap-pick button small.ap-why { display: block; font-size: 11px; }
.ap-pick button.off { border-style: dashed; opacity: .7; }
