/* App shell on top of the n26 site styles (site.css) and the tracker's form styles (tracker.css). */
.app { padding-block: 2rem 4rem; }
.app-card { max-width: 32rem; }
.app-form { display: grid; gap: .75rem; max-width: 32rem; margin-top: .75rem; }
.app-inline { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); max-width: 48rem; align-items: end; }
.app-inline .pe-row, .app-inline .app-msg { grid-column: 1 / -1; }
.pe-f small { color: var(--muted); font-size: .85rem; line-height: 1.3; }
.app-msg:empty { display: none; }
.pe-note.err, .app-msg.err { color: #f59a7a; }
.app-link { margin-top: 1rem; padding: .75rem 1rem; background: var(--panel); border-left: 4px solid var(--sodium); max-width: 48rem; }
.app-link p { margin: 0 0 .25rem; font-family: var(--label); }
.app-link .pe-row { flex-wrap: nowrap; }
.app-link input { flex: 1; min-width: 0; }
.app-acts { display: flex; gap: .4rem; flex-wrap: wrap; }
.app-acts .pe-add { margin-top: 0; }
.app-off td { color: var(--muted); }
.app-fail { padding: 2rem; color: #f88; }
.pe-t small { color: var(--muted); }
.hero h1 small { font-family: var(--label); font-size: 1rem; font-weight: 600; letter-spacing: .04em; }
/* Users table becomes one card per user on phones */
@media (max-width: 40rem) {
  .app-users thead { display: none; }
  .app-users, .app-users tbody, .app-users tr, .app-users td { display: block; }
  .app-users tr { padding: .6rem 0; border-bottom: 1px solid var(--line); }
  .app-users td { border: 0; padding: .05rem 0; }
  .app-users td[data-l]:not([data-l="Username"])::before { content: attr(data-l) ": "; color: var(--muted); }
  .app-users td.app-acts { padding-top: .4rem; }
}

/* Campaign list */
.app-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.app-tile { display: grid; gap: .2rem; padding: 1rem 1.1rem; background: var(--panel); border-top: 4px solid var(--sodium); text-decoration: none; font-family: var(--label); }
.app-tile:hover, .app-tile:focus-visible { background: var(--panel-2); }
.app-tile strong { font-size: 1.35rem; line-height: 1.15; }
.app-tile span { color: var(--muted); }
.app-tile .app-tile-k { color: var(--sodium); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }
.app-more summary { cursor: pointer; font-family: var(--label); color: var(--sodium); margin-bottom: .5rem; }

/* Campaign tabs */
.app-tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: .5rem; }
.app-tabs a { font-family: var(--label); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; color: var(--muted); padding: .4rem .7rem; border-bottom: 3px solid transparent; }
.app-tabs a:hover { color: var(--ink); }
.app-tabs a[aria-current="page"] { color: var(--sodium); border-bottom-color: var(--sodium); }
#tab { display: grid; gap: 2.5rem; }

.app-facts th { width: 11rem; text-transform: none; letter-spacing: 0; font-size: 1rem; }
.app-steps { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; font-family: var(--label); counter-reset: s; }
.app-steps li { display: grid; grid-template-columns: 2rem 1fr; column-gap: .5rem; counter-increment: s; }
.app-steps li::before { content: counter(s); grid-row: span 2; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.app-steps li.done::before { content: "✓"; background: var(--sodium); border-color: var(--sodium); color: var(--on-sodium); }
.app-steps span { color: var(--muted); font-size: .95rem; }
.app-btnlink { font-family: var(--label); font-weight: 600; font-size: .95rem; color: var(--sodium); border: 1px dashed var(--sodium); padding: .3rem .7rem; text-decoration: none; display: inline-block; }
.app-btnlink:hover { background: var(--panel); }
.app-gap { margin-top: 1rem; }
.app-dice { font-family: ui-monospace, Menlo, monospace; background: var(--panel-2); padding: 0 .35rem; border-radius: 3px; white-space: nowrap; }
.app-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.app-th { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.app-th h2 { margin-bottom: .5rem; }
.app-badge { font-family: var(--label); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.app-table .pe-t td:last-child { color: var(--muted); }
.app-edit input { min-width: 0; }
.app-edit td:nth-child(3) input { min-width: 9rem; }
.app-edit td input[data-f="summary"] { min-width: 16rem; }
.app-edit td input[data-f="att"], .app-edit td input[data-f="def"] { min-width: 12rem; }
.app-danger { border-top: 3px solid #e0702e; padding-top: 1rem; }
.app-danger h2 { color: #f59a7a; }
.pe button:disabled, .pe input:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 40rem) {
  .app-users td.app-acts:empty { display: none; }
  .app-tabs a { padding: .35rem .45rem; font-size: .95rem; }
}
.app-right { justify-content: flex-end; }
.app-terr td { padding-block: .35rem; }
.app-terr .pe-add { padding: .1rem .5rem; margin-top: 0; }
.app-narrow { display: none; }
.app-edit input[data-f="from"], .app-edit input[data-f="to"] { width: 3.2rem; min-width: 3.2rem; text-align: center; }
@media (max-width: 40rem) {
  .app-wide { display: none; }
  .app-narrow { display: block; }
}
/* in a table, the actions cell stays a table cell (flex would break the row's height and border); buttons sit side by side */
@media (min-width: 40.01rem) {
  .pe-t td.app-acts { display: table-cell; vertical-align: middle; white-space: nowrap; text-align: right; }
  .pe-t td.app-acts > * + * { margin-left: .4rem; }
}
.app-terr td.app-acts { display: table-cell; white-space: nowrap; text-align: right; }
.app-terr td.app-acts button + button { margin-left: .35rem; }

/* ---- gangs (milestone 2) */
.app-gangs { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.app-gangtile { display: flex; gap: .75rem; align-items: center; padding: .8rem 1rem; background: var(--panel); border-top: 4px solid var(--tone, var(--line)); text-decoration: none; font-family: var(--label); color: var(--ink); }
.app-gangtile:hover, .app-gangtile:focus-visible { background: var(--panel-2); }
.app-gangnew { border: 1px dashed var(--sodium); border-top-width: 4px; --tone: var(--sodium); }
.app-gangnew .app-plus { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; font-size: 1.8rem; line-height: 1; color: var(--on-sodium); background: var(--sodium); opacity: 1; border: 0; }
.app-gangtile img, .app-gangtile .app-dot { flex: none; width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; border: 2px solid var(--tone); }
.app-gangtile .app-dot { background: var(--tone); opacity: .6; }
.app-gangtile > span { display: grid; gap: .1rem; min-width: 0; }
.app-gangtile b { font-size: 1.2rem; color: var(--tone); }
.app-gangtile small { color: var(--muted); }
.app-gang .fh .roundel { border-color: var(--tone); }
.app-gang h2 { color: var(--tone, var(--ink)); }
.app-ganghead { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.app-ganghead h2, .app-gangname { margin: 0; flex: 1; min-width: 0; cursor: text; }
input.app-gangname { font: inherit; font-size: 1.6rem; width: 100%; }
.pe .app-ganghead button.app-gangpicbtn { flex: none; display: block; width: 6rem; height: 6rem; min-width: 0; min-height: 0; padding: 0 !important; border: 0; background: none; cursor: pointer; line-height: 0; border-radius: 50%; }
.app-gangpicbtn .app-gangpic { display: block; width: 100%; height: 100%; }
.app-ganglistrow { display: flex; align-items: flex-end; gap: 1rem; }
.app-ganglistrow label:first-child { flex: 1; min-width: 0; }
.app-gangpic { width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; border: 2px solid var(--tone, var(--line)); }
.app-status { display: grid; gap: .2rem; padding: .7rem 1rem; background: var(--panel); border-left: 4px solid var(--muted); margin-bottom: .75rem; font-family: var(--label); }
.app-status.s-submitted { border-left-color: var(--sodium); }
.app-status.s-approved { border-left-color: #6fbf73; }
.app-status.s-changes_requested { border-left-color: #e5675a; }
.app-status span { color: var(--muted); }
.app-sticky { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: .5rem 0; align-items: center; }
.app-sticky .pe-sum { margin: 0; flex: 1 1 14rem; }
.app-over { color: #e5675a; }
.app-import { max-width: none; padding: .75rem 1rem; background: var(--panel); margin-bottom: 1rem; }
.app-import summary { cursor: pointer; font-family: var(--label); }
.app-import .pe-row input { flex: 1 1 16rem; min-width: 0; }
.tr-fighter .pe-row { align-items: center; }
.app-gang .fighters { margin-top: 1rem; }

/* ---- landing page (milestone 3) */
.app-gname { color: var(--tone, var(--ink)); font-weight: 700; font-family: var(--label); }
.app-cycle h2 { margin-top: .2rem; }
.app-sched { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(3.6rem, 1fr)); gap: .3rem; }
.app-sched li { display: grid; justify-items: center; gap: .05rem; padding: .45rem .2rem; background: var(--panel); border-top: 3px solid var(--line); font-family: var(--label); text-align: center; }
.app-sched li b { font-size: 1.15rem; }
.app-sched li span, .app-sched li small { font-size: .72rem; color: var(--muted); letter-spacing: .02em; }
.app-sched li.ph-occupation { border-top-color: #8fa7b3; }
.app-sched li.ph-downtime { border-top-color: #6c7a80; }
.app-sched li.ph-takeover { border-top-color: #e5675a; }
.app-sched li.past { opacity: .55; }
.app-sched li.now { background: var(--sodium); color: #1a1a1a; }
.app-sched li.now span, .app-sched li.now small { color: #1a1a1a; }
.app-next { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.app-next li { padding: .7rem 1rem; background: var(--panel); border-left: 4px solid var(--sodium); display: grid; gap: .15rem; }
.app-next li.who-arbitrator { border-left-color: #8fa7b3; }
.app-next a { color: var(--ink); }
.app-fwrap { display: grid; gap: .4rem; align-content: start; }
.app-fwrap > button { justify-self: start; }
.app-looks { align-items: end; }

/* ---- challenges and battles (milestone 4) */
.app-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.app-list li { background: var(--panel); padding: .7rem 1rem; display: grid; gap: .3rem; }
.app-list li p { margin: 0; }
.app-list li small { color: var(--muted); }
.app-list li.ch-issued { border-left: 4px solid var(--sodium); }
.app-order { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; counter-reset: turn; }
.app-order li { counter-increment: turn; display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: .2rem .6rem; background: var(--panel); padding: .55rem .8rem; }
.app-order li::before { content: counter(turn); font-family: var(--label); font-weight: 700; font-size: 1.2rem; color: var(--muted); grid-row: span 2; }
.app-order li.now { outline: 2px solid var(--sodium); }
.app-order li.now::before { color: var(--sodium); }
.app-order li.st-passed, .app-order li.st-skipped { opacity: .65; }
.app-order li > small { grid-column: 2; color: var(--muted); }
.app-order .app-acts { grid-column: 3; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
@media (max-width: 40rem) { .app-order li { grid-template-columns: 2rem 1fr; } .app-order .app-acts { grid-column: 2; grid-row: auto; justify-content: flex-start; } }
.app-issue { margin-top: .5rem; }
.app-vs h2 small { color: var(--muted); font-size: .7em; margin: 0 .3rem; }
.app-vs h2 a { text-decoration: none; }
.app-parts { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); margin: .75rem 0; }
.app-part { background: var(--panel); padding: .8rem 1rem; display: grid; gap: .3rem; align-content: start; }
.app-part.empty { outline: 1px dashed var(--line); outline-offset: -1px; background: transparent; }
.app-part h3 { margin: 0; font-size: 1rem; }
.app-part p { margin: 0; }
.app-part small { color: var(--muted); }
.app-pick { display: flex; gap: .4rem; flex-wrap: wrap; }
.app-pick select { min-width: 0; flex: 1 1 10rem; }
.app-crew { font-family: var(--label); }

/* ---- crews, the game and results (milestone 5) */
.app-sides { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.app-side { background: var(--panel); padding: .8rem 1rem; border-top: 4px solid var(--tone, var(--line)); display: grid; gap: .45rem; align-content: start; }
.app-side h3 { margin: 0; color: var(--tone, var(--ink)); }
.app-side h3 small { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; margin-left: .3rem; }
.app-side p { margin: 0; }
.app-crewlist { margin: 0; padding-left: 1.2rem; }
.app-crewlist small, .app-fpick small { color: var(--muted); }
.app-fpicks { display: grid; gap: .25rem; }
.app-fpick:has(input:disabled) { opacity: .55; }
.app-orow { display: flex; flex-wrap: wrap; gap: .2rem .7rem; align-items: center; }
.app-orow span { flex: 1 1 8rem; font-family: var(--label); }
.app-events { list-style: none; padding: 0; margin: 0; display: grid; gap: .25rem; }
.app-events li { display: grid; grid-template-columns: 1fr auto; gap: 0 .5rem; padding: .35rem .5rem; background: var(--bg); }
.app-events li small { grid-column: 1; color: var(--muted); }
.app-events li .pe-x { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.app-events li.ev-injury { border-left: 3px solid #e5675a; }
.app-events li.ev-xp { border-left: 3px solid #8fa7b3; }
.app-ftiles { display: grid; gap: .25rem; margin-bottom: .5rem; }
.app-ftile { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; text-align: left; padding: .25rem .6rem; background: var(--bg); border: 1px solid var(--line); border-left: 3px solid #8fa7b3; color: var(--ink); font: inherit; width: 100%; min-height: 0; }
.pe button.app-ftile { background: var(--bg); color: var(--ink); font: inherit; font-weight: 400; cursor: pointer; min-height: 0; padding: .25rem .6rem; margin: 0; border: 1px solid var(--sodium); border-left: 3px solid var(--sodium); text-transform: none; letter-spacing: normal; display: flex; justify-content: space-between; align-items: baseline; width: 100%; text-align: left; white-space: normal; }
.pe button.app-ftile:hover, .pe button.app-ftile:focus-visible { background: var(--panel); }
.app-ftile b { font-family: var(--label); font-weight: 600; }
.app-ftile b small { margin-left: .35rem; font-weight: 400; color: var(--muted); }
.app-ftile span { font-family: var(--label); white-space: nowrap; }
.app-fdlg .app-events { margin-top: .75rem; }
.app-log select { min-width: 0; flex: 1 1 12rem; }
.app-log .pe-f select { width: 100%; }
.app-radios { border: 0; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.app-radios legend { font-family: var(--label); padding: 0; margin-bottom: .2rem; width: 100%; }
.app-approvals { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: .25rem; }
.app-approvals li { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; padding: .45rem .7rem; background: var(--panel); border-left: 4px solid var(--line); font-family: var(--label); }
.app-approvals li.ok { border-left-color: #6fbf73; }
.app-approvals li small { color: var(--muted); }
.app-log-list li p { margin: 0; }

/* ---- post-cycle and syncs (milestone 6) */
.app-totals { display: flex; flex-wrap: wrap; gap: .3rem .9rem; padding: .6rem 1rem; background: var(--panel); font-family: var(--label); margin-bottom: .6rem; }
.app-acts-t th { width: 30%; vertical-align: top; }
.app-acts-t th small { display: block; color: var(--muted); font-weight: 400; }
.app-acts-t td select { width: 100%; }
.app-acts-t td .pe-f { margin-top: .4rem; }
.app-checks { display: grid; gap: .2rem; margin-top: .4rem; }
.app-adv { background: var(--panel); padding: .7rem 1rem; margin-bottom: .5rem; display: grid; gap: .4rem; }
.app-adv h3 { margin: 0; }
.app-adv h3 small { color: var(--muted); font-weight: 400; }
.app-adv select { min-width: 0; flex: 1 1 12rem; }
.app-changes { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .2rem; }
.app-changes li { padding: .35rem .6rem; background: var(--bg); display: grid; gap: .1rem; border-left: 3px solid var(--line); overflow-wrap: anywhere; }
.app-changes li.flag { border-left-color: var(--sodium); }
.app-changes li.skipped { opacity: .7; border-left-color: #e5675a; }
.app-changes li small { color: var(--muted); }
.app-sync.flagged { outline: 2px solid var(--sodium); }
.app-list li.ps-approved { border-left: 4px solid #6fbf73; }
.app-list li.ps-submitted { border-left: 4px solid var(--sodium); }
.app-list li.ps-changes_requested { border-left: 4px solid #e5675a; }

/* ---- headings with a button beside them, and pop-up dialogs */
.app-headrow { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.app-headrow h2 { margin: 0; }
.app-dialog .app-headrow { flex-wrap: nowrap; align-items: flex-start; }
.app-dialog .app-headrow h2 { flex: 1; min-width: 0; }
.app-dialog .app-headrow .pe-x { flex: none; }
.pe-x svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
section > .app-headrow { margin-bottom: 1rem; }
.app-dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-top: 4px solid var(--sodium); padding: 1.25rem; width: min(34rem, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
.app-dialog::backdrop { background: rgb(0 0 0 / .65); }
.app-dialog .app-form { max-width: none; }
.app-dialog .app-headrow { margin-bottom: .5rem; }

/* ---- buttons: one standard size for every kind (filled, dashed, danger, ×, link) ----
   Same height, padding, font and border width, so buttons line up side by side. Card
   buttons from the n26 site (fighter names, XP, pop-up close, tiles) keep their own look. */
:root { --btn-h: 2.25rem; }
.pe button:not(.fname):not(.xp-btn):not(.fc-close):not(.tr-tile):not(.app-ftile), .pe .app-btnlink, .pe-crop button {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  min-height: var(--btn-h); margin: 0; padding: 0 .9rem; border: 1px solid transparent;
  font-family: var(--label); font-weight: 600; font-size: .95rem; line-height: 1.2; text-decoration: none; white-space: nowrap; vertical-align: middle;
}
/* same selector weight as above, so these win */
.pe button.pe-add:not(.fname):not(.xp-btn):not(.fc-close), .pe .app-btnlink, .pe-crop button.pe-add { border: 1px dashed var(--sodium); }
.pe button.pe-x:not(.fname):not(.xp-btn):not(.fc-close) { min-width: var(--btn-h); padding: 0; font-size: 1.25rem; }
.pe-row { align-items: center; }
#addtype { min-width: 0; flex: 1 1 16rem; max-width: 30rem; min-height: var(--btn-h); }
.app-equip select { width: 100%; }

/* ---- the top nav: Campaigns on the left, the account button on the right */
.app-topnav ul { display: flex; align-items: center; justify-content: space-between; }
.app-topnav li.app-user { margin-left: auto; }
.app-topnav #userbtn { display: inline-flex; align-items: center; gap: .45em; min-height: var(--btn-h); padding: 0 .3rem; background: none; border: 0; color: inherit;
  font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.app-topnav #userbtn svg { width: 1.35em; height: 1.35em; flex: none; }
.app-topnav #userbtn:hover, .app-topnav #userbtn:focus-visible { color: var(--sodium); }
@media (max-width: 44rem) { .app-topnav .app-user-name { display: none; } .app-topnav a.home span { display: inline; } }
.app-dlg-sec { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.app-dlg-sec h3 { margin: 0 0 .3rem; }
.app-dlg-foot { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.app-buy select, #addrecruit { min-width: 0; flex: 1 1 16rem; max-width: 30rem; min-height: var(--btn-h); }

/* ---- the gang editor's fighters: a live card, tools, gear tags, skill picker, form */
.app-fboxes { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); align-items: start; }
.app-fbox { display: grid; gap: .5rem; padding: .6rem; background: var(--bg); border: 1px solid var(--line); }
.app-fbox.open { border-color: var(--tone, var(--sodium)); }
.app-fbox .fighter { margin: 0; }
.app-ftools { margin-top: 0; }
.app-gear { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.app-gear li { display: inline-flex; align-items: center; gap: .35rem; padding-left: .6rem; background: var(--panel); border: 1px solid var(--line); font-family: var(--label); font-size: .9rem; }
.app-gear li small { color: var(--muted); }
.pe .app-gear li button.pe-x { min-width: 1.9rem; min-height: 1.9rem; font-size: 1rem; }
.app-skillpick { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.app-skillpick select, .app-skillpick input { min-height: var(--btn-h); flex: 1 1 9rem; min-width: 0; }
.app-fform { display: grid; gap: .5rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.app-fname { margin-top: 0; align-items: end; }
.app-fname .pe-f { flex: 1 1 12rem; margin: 0; }
.app-skilltags li { border-style: dashed; }
.app-equipdlg { width: min(40rem, calc(100vw - 32px)); }
.app-equipdlg h3 { margin: 1rem 0 .4rem; }
.app-equipdlg .app-gear { margin-bottom: 1.25rem; }
.app-equipdlg .app-gapb { margin-bottom: 1.25rem; }
.app-equipdlg input[type=search] { width: 100%; min-height: var(--btn-h); }
.app-picklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.pe .app-picklist button:not(.fname):not(.xp-btn):not(.fc-close):not(.tr-tile) { width: 100%; justify-content: space-between; text-align: left; white-space: normal; padding: .45rem .7rem; background: var(--bg); color: var(--ink); border: 1px solid var(--line); font-weight: 400; }
.pe .app-picklist button:not(.fname):hover, .pe .app-picklist button:not(.fname):focus-visible { border-color: var(--sodium); }
.app-picklist span { display: grid; gap: .1rem; }
.app-picklist small { color: var(--muted); font-size: .8rem; }
.app-picklist em { font-style: normal; font-family: var(--label); font-weight: 700; color: var(--sodium); }
/* the card is the editor: the portrait and the name are tappable */
.app-fcard .fh .roundel, .app-fcard .fh h4 { cursor: pointer; }
.app-fcard .fh .roundel:hover { outline: 2px dashed var(--sodium); outline-offset: 2px; }
.app-fcard .fh h4:hover { text-decoration: underline dashed var(--sodium); text-underline-offset: .25em; }
.app-rename { font: inherit; font-family: var(--label); font-weight: 700; font-size: 1.1rem; width: 100%; min-height: var(--btn-h); color: var(--ink); background: var(--bg); border: 1px solid var(--sodium); padding: 0 .5rem; }

.app-equipdlg .pe-count { margin: 0 0 1rem; font-family: var(--label); font-size: 1.4rem; color: var(--sodium); }

/* a submitted gang: same picture and name as the editor, not editable by click */
.app-ganghead img.app-gangpicview { flex: none; width: 6rem; height: 6rem; }
.app-ganghead h2.app-gangnameview { cursor: default; }
.app-ganghead .app-gangcolour { flex: none; }

.app-fwrap .fh .roundel { cursor: pointer; }
.app-fwrap .fh .roundel:hover { outline: 2px dashed var(--sodium); outline-offset: 2px; }

/* Members tab: the invite link form on one row, and the player search box */
.app-invform { grid-template-columns: minmax(0, 2fr) minmax(6rem, 1fr) minmax(5rem, 1fr) auto; align-items: end; max-width: 48rem; }
.app-invform .app-msg { grid-column: 1 / -1; }
.app-addform { grid-template-columns: minmax(0, 1fr) auto; align-items: start; max-width: 32rem; }
.app-addform .app-msg { grid-column: 1 / -1; }
.app-combo { position: relative; }
.app-combo input { width: 100%; }
.app-combo ul { position: absolute; z-index: 5; left: 0; right: 0; margin: 2px 0 0; padding: 0; list-style: none; max-height: 14rem; overflow: auto; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.app-combo li { padding: .55rem .75rem; cursor: pointer; }
.app-combo li[aria-selected="true"], .app-combo li[data-i]:hover { background: var(--sodium); color: #111; }
.app-combo li[aria-selected="true"] small, .app-combo li[data-i]:hover small { color: #333; }
.app-combo li.app-none { cursor: default; color: var(--muted); }
.app-link p small { color: var(--muted); font-weight: normal; }
@media (max-width: 38rem) { .app-invform { grid-template-columns: 1fr 1fr; } .app-invform label:first-child, .app-invform button { grid-column: 1 / -1; } }

/* top bar: Campaigns at the far left, the account button at the far right */
.jump.app-topnav ul { justify-content: space-between; flex-wrap: nowrap; overflow-x: visible; }
.jump.app-topnav li:first-child, .jump.app-topnav li:last-child, .jump.app-topnav li.app-user { margin: 0; }

/* Settings → Discord: the kinds of message as a tidy list */
.app-events { display: grid; gap: .5rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); margin-bottom: 1rem; }
.app-events label { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; }
.app-events small { color: var(--muted); }

/* Territory cards, grouped by who holds them */
.app-tgroup { margin-bottom: 2rem; }
.app-tgroup h2 small { color: var(--muted); font-size: .6em; }
.app-tgroup h2.app-gname { color: var(--tone, inherit); }
.app-tcards { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.app-tcard { background: var(--panel); border-left: 4px solid var(--tone, var(--line)); padding: .75rem 1rem; display: grid; gap: .4rem; align-content: start; }
.app-tcard header { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.app-tcard h3 { margin: 0; font-size: 1.1rem; }
.app-tcard h3 small { color: var(--muted); font-weight: normal; }
.app-tcard dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; margin: 0; }
.app-tcard dt { color: var(--muted); font-family: var(--label); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; padding-top: .15rem; }
.app-tcard dd { margin: 0; }
.app-tcard .pe-row { justify-content: flex-end; }

.app-fwrap .fh h4 { cursor: pointer; }
.app-fwrap .fh h4:hover { text-decoration: underline dotted; }
h2.app-gangnameview[role=button] { cursor: text; }

/* Gang Special Rules fold-out on the gang sheet */
.app-gangrules { background: var(--panel); border-left: 4px solid var(--tone, var(--line)); padding: .6rem 1rem; margin: .75rem 0; }
.app-gangrules summary { cursor: pointer; font-family: var(--label); font-weight: 600; letter-spacing: .04em; }
.app-gangrules summary small { color: var(--muted); margin-left: .4rem; }
.app-gangrules h4 { margin: 1rem 0 .25rem; color: var(--sodium); }
.app-gangrules p { margin: .5rem 0; }
.app-gangrules p.grouped { padding-left: .9rem; border-left: 2px solid var(--line); }

/* the campaign tabs sit in the top bar, between Campaigns and the account button */
.app-topnav li.app-navtabs { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.app-topnav .app-tabs { border: 0; margin: 0; flex-wrap: wrap; justify-content: center; }
.app-topnav .app-tabs a { padding: .3rem .6rem; font-size: 1.05rem; }
@media (max-width: 44rem) { .jump.app-topnav ul { flex-wrap: wrap; } .app-topnav li.app-navtabs { order: 3; flex-basis: 100%; } }

.app-ganghead .app-allgangs { flex: none; align-self: flex-start; }

.app-you { color: var(--sodium); font-weight: 700; }
.app-battletitle { cursor: text; }
.app-battletitle:hover { text-decoration: underline dotted; }

/* a section that folds away (the Scenario once it is locked) */
.app-fold { border-top: 1px solid var(--line); padding-top: .5rem; margin-bottom: 2.5rem; }
.app-fold > summary { cursor: pointer; display: flex; align-items: center; gap: .75rem; list-style: none; }
.app-fold > summary::-webkit-details-marker { display: none; }
.app-fold > summary::before { content: '▸'; color: var(--sodium); font-size: 1.3rem; }
.app-fold[open] > summary::before { content: '▾'; }
.app-fold .app-foldh { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 6vw, 3rem); line-height: 1; color: var(--sodium); }
.app-fold > summary small { color: var(--muted); }
.app-fold[open] > summary { margin-bottom: 1rem; }

/* each part of a locked scenario folds away on its own */
details.app-partfold { background: var(--panel); padding: .7rem 1rem; }
.app-partfold > summary { cursor: pointer; display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; list-style: none; }
.app-partfold > summary::-webkit-details-marker { display: none; }
.app-partfold > summary::before { content: '▸'; color: var(--sodium); }
.app-partfold[open] > summary::before { content: '▾'; }
.app-partfold .app-partlabel { font-family: var(--label); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--sodium); font-size: .9rem; }
.app-partfold[open] > summary { margin-bottom: .6rem; }
details.app-partfold { align-self: start; }   /* in the parts grid, a collapsed part doesn't stretch to its open neighbour's height */

/* a locked scenario: a tidy list, one row per part. Collapsed: arrow, label, name, dice. Expanded: the same row with its wording under it. */
.app-parts.locked { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
.app-parts.locked details.app-partfold { background: none; padding: 0; border-bottom: 1px solid var(--line); align-self: auto; }
.app-parts.locked .app-partfold > summary { display: grid; grid-template-columns: 1rem minmax(8rem, 15rem) 1fr auto; align-items: baseline; gap: .75rem; padding: .7rem .25rem; }
.app-parts.locked .app-partfold > summary .app-dice { justify-self: end; }
.app-parts.locked .app-partfold[open] > summary { margin: 0; }
.app-parts.locked .app-partfold > summary:hover { background: var(--panel); }
.app-parts.locked .app-partbody { padding: 0 .25rem 1rem calc(1rem + .75rem + .25rem); max-width: 46rem; }
.app-parts.locked .app-partbody p { margin: .25rem 0; }
@media (max-width: 40rem) {
  .app-parts.locked .app-partfold > summary { grid-template-columns: 1rem 1fr auto; }
  .app-parts.locked .app-partfold > summary .app-partlabel { grid-column: 2 / 4; }
  .app-parts.locked .app-partfold > summary b { grid-column: 2; }
  .app-parts.locked .app-partbody { padding-left: 1.75rem; }
}
.app-log input[hidden] { display: none; }
.app-scenario h2 small { color: var(--muted); font-size: 1rem; font-family: var(--body, inherit); margin-left: .5rem; }
.app-scenario > h2 { font-size: clamp(1.4rem, 4vw, 1.8rem); }

/* the gang colour: a circle tucked behind the top-left of the gang picture */
.app-gangpicwrap { position: relative; flex: none; display: block; width: 6rem; height: 6rem; margin: .6rem 0 0 .6rem; }
.app-gangpicwrap > .app-gangpic, .app-gangpicwrap > .app-gangpicbtn { position: relative; z-index: 1; }
.app-gangdot { position: absolute; z-index: 0; top: -.6rem; left: -.6rem; width: 3rem; height: 3rem; box-sizing: border-box; border-radius: 50%; border: 0; padding: 0; background: var(--tone, var(--line)); -webkit-appearance: none; appearance: none; cursor: pointer; }
span.app-gangdot { cursor: default; }
.app-gangdot::-webkit-color-swatch-wrapper { padding: 0; }
.app-gangdot::-webkit-color-swatch { border: 0; border-radius: 50%; }
.app-gangdot::-moz-color-swatch { border: 0; border-radius: 50%; }
.app-gangdot:hover, .app-gangdot:focus-visible { outline: 2px solid var(--sodium); outline-offset: 2px; }
.pe input.app-gangdot { width: 3rem; height: 3rem; min-width: 0; min-height: 0; max-width: none; padding: 0; margin: 0; border: 0; background: var(--tone, var(--line)); }
.app-battle > summary small { font-size: 1rem; }
.app-battle { margin-top: 1rem; margin-bottom: 1.5rem; }

/* ---- results: a segmented result picker and a card of rewards per gang */
.app-resline { margin: 0 0 .75rem; }
.app-resform { display: grid; gap: .9rem; max-width: none; margin-bottom: 1rem; }
.app-resrow { display: grid; gap: .3rem; }
.app-reslabel { font-family: var(--label); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.app-seg { display: flex; flex-wrap: wrap; gap: .35rem; }
.app-segopt { position: relative; cursor: pointer; }
.app-segopt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.app-segopt span { display: block; padding: .4rem .9rem; background: var(--bg); border: 1px solid var(--line); font-family: var(--label); font-weight: 600; color: var(--ink); }
.app-segopt:hover span { border-color: var(--sodium); }
.app-segopt:has(input:checked) span { border-color: var(--sodium); background: var(--panel); box-shadow: inset 0 -3px 0 var(--sodium); }
.app-segopt:has(input:focus-visible) span { outline: 2px solid var(--sodium); outline-offset: 2px; }
.app-rewcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem; margin: .75rem 0 1rem; }
.app-rewcard { background: var(--panel); border-top: 4px solid var(--tone, var(--line)); padding: .75rem .9rem; }
.app-rewcard h4 { margin: 0 0 .5rem; font-family: var(--label); }
.app-rewcard h4 .app-gname { color: var(--tone, var(--ink)); }
.app-rewcard h4 small { color: var(--muted); font-weight: 400; }
.app-rewcard p { margin: .35rem 0 0; }
.app-reward { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; align-items: end; }
.app-reward .pe-row { grid-column: 1 / -1; }
.app-reward input { width: 100%; box-sizing: border-box; }
.pe .app-battle .app-foldh { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.app-ftile b small.app-ftinj { color: #f0897e; border: 1px solid #e5675a; padding: 0 .35rem; font-weight: 600; margin-left: .35rem; }
.pe button.pe-x svg { display: block; }
#log { margin-bottom: 2rem; }
.hero h1.app-battletitle { cursor: text; }
.hero h1.app-battletitle:hover { text-decoration: underline dotted; }
.hero h1 input.app-rename { font: inherit; width: 100%; box-sizing: border-box; background: transparent; color: inherit; border: 0; border-bottom: 3px dashed currentColor; padding: 0; outline: none; }
.app-vsline { display: block; color: var(--muted); font-size: .9rem; margin-top: .1rem; }

/* fighter cards: what has changed since the campaign started */
.app-badge.st-in_recovery { color: #ff7a45; }
.app-badge.st-critical, .app-badge.st-captured { color: #ff4d4d; }
.fighter .c.st-up b, .fighter .c.st-up span { color: #6cb4ff; }
.fighter .c.st-down b, .fighter .c.st-down span { color: #ff7a45; }
.fighter .foot .sk-up, .fighter .foot .sk-up .sk { color: #6cb4ff; }
.fighter .foot .inj, .fighter .foot .inj .sk { color: #ff7a45; }
.fighter .foot .inj-crit, .fighter .foot .inj-crit .sk { color: #ff4d4d; }

/* the gang sheet's change log */
.app-ganglog, .app-gone { margin: 1rem 0; }
.app-ganglog .app-foldh, .app-gone .app-foldh { font-size: clamp(1.4rem, 4vw, 1.8rem); }
.app-ganglog > summary small, .app-gone > summary small { font-size: 1rem; }
.app-logentries { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.app-logentries > li { background: var(--bg); border-left: 3px solid #8fa7b3; padding: .45rem .7rem; }
.app-logentries > li.lg-post_cycle { border-left-color: var(--sodium); }
.app-logentries > li.lg-battle { border-left-color: #6cb4ff; }
.app-logentries .lg-head { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.app-logentries .lg-head small { color: var(--muted); }
.app-logentries ul { margin: .3rem 0 0; padding-left: 1.1rem; }

/* post-cycle: collect income */
.app-inclist { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .4rem; }
.app-inc { background: var(--panel); border-left: 3px solid var(--line); padding: .5rem .8rem; }
.app-inchead { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.app-inchead b { font-family: var(--label); font-size: 1.05rem; }
.app-inchead small { color: var(--muted); }
.app-incamt { margin-left: auto; font-family: var(--label); white-space: nowrap; }
.app-inc .pe-note { margin: .2rem 0 0; }
.app-inc .app-seg { margin-top: .5rem; }
.app-incsum { max-width: 28rem; }
.app-incsum td.app-num, .app-incsum th.app-num { text-align: right; }
.app-incsum .app-inctotal th { color: var(--sodium); font-size: 1.1rem; border-top: 2px solid var(--line); }
.app-incsum .app-incsub td { color: var(--muted); font-style: italic; border-top: 1px dashed var(--line); }
.pe-t thead th { font-family: var(--label); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; font-weight: 600; border-bottom: 2px solid var(--line); }
.pe-t thead th.app-num { text-align: right; }
.app-acts-t td small { display: block; color: var(--muted); }
.app-acts-t select.act-work { color: #6cb4ff; }
.app-incsum { max-width: none; }
.app-incsum .app-inctotal td { color: var(--sodium); font-weight: 700; border-top: 2px solid var(--line); }
.app-incsum select { max-width: 100%; }
.app-equiprow { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; }
.app-equiprow select { flex: 1 1 12rem; min-width: 0; }
.app-pickcols { display: flex; gap: 1rem; align-items: baseline; }
.app-pickcols em { min-width: 3.2rem; text-align: right; }
.app-tpcol { color: var(--muted); }
.app-picklist button:disabled { opacity: .4; cursor: not-allowed; }
.app-advrow { margin-bottom: .6rem; }
.app-skillprev { list-style: none; margin: .3rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem .9rem; font-size: .85rem; }
.app-skillprev .has { color: var(--muted); text-decoration: line-through; }
.app-sell { display: inline-flex; gap: .3rem; margin-left: .5rem; flex-wrap: wrap; }
.app-gear button[hidden] { display: none !important; }
#editbtns { display: contents; }
.xp-pop { padding: 1rem 1.25rem; }
.xp-pop h3 { margin: 0 2rem .6rem 0; }
.xp-pop td small { display: block; color: var(--muted); font-size: .8rem; }
.xp-pop tfoot td { font-weight: 700; border-top: 1px solid var(--line); }
.fighter .xp-btn { font: inherit; border: 0; padding: .2rem 0; cursor: pointer; }   /* the tile keeps its own colours (.c.x) */
.fighter .xp-btn:hover b, .fighter .xp-btn:focus-visible b { text-decoration: underline; }
.app-pfwrap .roundel { cursor: pointer; }
.app-advrow .pe-row { align-items: center; margin-top: .2rem; }
.app-advroll { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; flex: none; }
.app-advroll select { flex: none; width: 3.6rem; min-width: 0; }
.app-advrow .pe-row > select { flex: 1 1 14rem; }
.app-docset { margin-top: .4rem; }
.app-docset .pe-row { margin-top: 0; }
.app-subs { display: block; color: var(--muted); font-size: .8rem; margin-top: .15rem; }
.pe-t td > select, .pe-t td > input + input { margin-top: .25rem; }
.app-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.app-pill { border: 1px solid var(--line); padding: .2rem .6rem; font-family: var(--label); font-weight: 600; background: var(--bg); }
.app-pill.won { border-color: var(--sodium); }   /* a Territory won in play */
.app-facts td .pe-add { margin-left: .5rem; }
/* the gang details in two columns */
.app-facts2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.5rem; margin-top: .75rem; }
.app-fact { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.app-fact span { font-family: var(--label); color: var(--muted); font-weight: 600; }
.app-fact b { font-family: var(--label); text-align: right; }
.app-factlists { gap: 0 2.5rem; margin-top: 1rem; }
.app-factlists h4 { margin: 0 0 .4rem; font-family: var(--label); font-size: .95rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.app-notes { margin: 1rem 0 0; }
@media (max-width: 720px) { .app-facts2 { grid-template-columns: minmax(0, 1fr); } }
.app-tcard header .app-tright { display: flex; align-items: center; gap: .4rem; }
.app-tcard header .pe-x { min-width: 2rem !important; width: 2rem; height: 2rem; padding: 0 !important; }   /* beats the general button padding, which squeezed the icon */
.app-tname { cursor: text; }
.app-tname:hover { text-decoration: underline dotted; }
.app-tcard .app-rename { width: 100%; }
/* messages */
.app-msgs { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .6rem; }
.app-msgs li { background: var(--panel); border-left: 4px solid var(--line); padding: .6rem .9rem; }
.app-msgs li.mine { border-left-color: var(--sodium); }
.app-msgs li.unread { background: var(--panel-2); border-left-color: var(--sodium); }
.app-msghead { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.app-msghead small { color: var(--muted); }
.app-msgs p { margin: .3rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.app-tabs .app-badge { margin-left: .25rem; }
.app-arbact { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }
/* in-window confirm / prompt / alert boxes (web/js/shared/dialog.js) */
.app-msgdlg { width: min(30rem, calc(100vw - 32px)); }
.app-msgtext { margin: 0 0 1rem; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.05rem; }
.app-msgdlg input, .app-msgdlg textarea { width: 100%; margin-bottom: 1rem; }
.app-msgdlg .pe-row { margin-top: 0; }
.app-docset .app-advroll { white-space: normal; flex-wrap: wrap; }
.app-docset .pe-row { flex-wrap: wrap; }
.app-recphoto { margin-top: .25rem; }
.app-recpic { display: block; width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; margin-top: .3rem; border: 1px solid var(--line); }
/* the campaign type, End of Days and phase lengths (New campaign, Settings) */
.app-type { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: .5rem; }
.app-type[disabled] { opacity: .7; }
.app-typecards { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .5rem; margin-top: .25rem; }
.app-typecard { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; padding: .9rem .6rem; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); font-family: var(--label); font-size: 1.1rem; cursor: pointer; }
.app-typecard input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.app-typecard:has(input:checked) { border-color: var(--sodium); box-shadow: inset 0 0 0 1px var(--sodium); background: var(--panel); }
.app-typecard:has(input:focus-visible) { outline: 2px solid var(--sodium); outline-offset: 2px; }
/* the campaigns page has no Campaigns link: the account button still sits on the right */
.jump.app-topnav li.app-user:only-child { margin-left: auto; }
/* the roll dialog: Roll, or enter the dice rolled */
.app-rolldlg { max-width: 30rem; }
.app-rolldlg .app-rolldice { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.app-rolldlg .app-rolldice .pe-f { flex: none; width: 4.5rem; margin: 0; text-align: center; }
.app-rolldlg .app-rolldice input { width: 100%; min-width: 0; box-sizing: border-box; text-align: center; font-size: 1.4rem; padding: .35rem .2rem; -moz-appearance: textfield; }   /* (the generic input min-width would push the dice boxes past their labels) */
.app-rolldlg .app-rolldice input::-webkit-inner-spin-button, .app-rolldlg .app-rolldice input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.app-rollor { margin: .75rem 0 .25rem; }
/* Dark Uprising: the side in Ascendancy */
.app-ascend { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .25rem 0 .75rem; }
.app-badge.asc-chaos { background: #7a1f1f; color: #fff; }
.app-badge.asc-order { background: #1f4a7a; color: #fff; }
.app-rollgrp { border: 1px solid var(--line); padding: .4rem .75rem .6rem; margin: 0 0 .6rem; }
.app-rollgrp legend { padding: 0 .3rem; font-family: var(--label); }
.app-rolldlg .app-rollval { font-family: var(--label); font-size: 1.4rem; color: var(--sodium); padding-bottom: .45rem; min-width: 3rem; }

.app-adv { border: 1px solid var(--line); padding: .5rem .8rem; }
.app-adv > summary { cursor: pointer; font-family: var(--label); color: var(--sodium); }
.app-adv > .app-form { margin-top: .6rem; }

.app-box { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--sodium); padding: .8rem 1.1rem 1.1rem; margin-top: 1.2rem; }
.app-box > h2 { margin-top: 0; }

fieldset.pe-f.need { border-color: var(--sodium); }   /* a required choice not made yet */

.app-options { display: flex; flex-wrap: wrap; gap: .75rem; align-items: stretch; margin: .75rem 0; }
.app-options > fieldset { flex: 1 1 11rem; margin: 0; min-width: 0; }

.app-setup { border-left: 4px solid var(--sodium); background: var(--panel-2); padding: 0 .9rem; margin: -.4rem 0 .4rem; }
.app-setup[open] { padding-bottom: .6rem; }
.app-setup > summary { cursor: pointer; font-family: var(--label); font-size: 1.1rem; color: var(--ink); padding: .3rem 0; }
.app-setup > summary small { color: var(--muted); margin-left: .5rem; }

.app-ftools .app-fmove { margin-left: auto; display: inline-flex; align-items: center; gap: .5rem; }   /* reorder and delete stay on the right of the card */

.app-slothead { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.app-slothead h4 { margin: .6rem 0 .3rem; }

.app-dieicon { width: 1.1em; height: 1.1em; margin-right: .4em; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }

.app-terrcard { background: var(--panel-2); border-top: 4px solid var(--sodium); padding: .6rem .9rem .8rem; margin: .6rem 0; display: grid; gap: .5rem; }
.app-terrcard.empty { border-top-style: dashed; }
.app-terrcard header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.app-terrcard h4 { margin: 0; font-size: 1.3rem; color: var(--sodium); }
.app-terrkick { color: var(--muted); font-family: var(--label); text-transform: uppercase; letter-spacing: .05em; }
.app-terrfacts { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; margin: 0; }
.app-terrfacts dt { font-family: var(--label); color: var(--muted); }
.app-terrfacts dd { margin: 0; }

.app-sidejobs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: .5rem; }
.app-sidejobs:empty { display: none; }
.app-parts.locked .app-sidejobs { gap: 0 1rem; }

.app-parts:not(.locked) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app-parts .app-wide { grid-column: 1 / -1; }
@media (max-width: 36rem) { .app-parts:not(.locked) { grid-template-columns: 1fr; } }

.app-crewgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1.5rem; margin: .3rem 0; }
.app-crewside { display: grid; gap: .2rem; align-content: start; }
.app-crewside > span { color: var(--muted); font-family: var(--label); }
@media (max-width: 36rem) { .app-crewgrid { grid-template-columns: 1fr; } }

/* a locked scenario: Deployment and Objective side by side, the Side Jobs in a row, the Crew across the full width */
.app-parts.locked { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
.app-parts.locked .app-wide .app-partbody { max-width: none; }
@media (max-width: 40rem) { .app-parts.locked { grid-template-columns: 1fr; } }

/* Side Jobs: two to a row, the first gang's on the left and the second's on the right (a Guilder Stronghold adds a second row) */
.app-sidejobs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 36rem) { .app-sidejobs { grid-template-columns: 1fr; } }

/* multiplayer battles */
.app-melee-side { border-top: 4px solid var(--tone, var(--line)); background: var(--panel); padding: .6rem 1rem 1rem; margin: 1rem 0; }
.app-melee-side h3 { margin: .2rem 0 .6rem; display: flex; align-items: baseline; gap: .6rem; }
.app-melee-side h3 small { color: var(--muted); }
.app-logform { margin-bottom: .6rem; }
.app-evt { display: inline-flex; align-items: center; gap: .25rem; margin: 0 .6rem .2rem 0; padding: .05rem .4rem; background: var(--panel-2); font-family: var(--label); }
.app-out td { opacity: .55; }

/* Dark Uprising on the post-cycle page: the score, Ascendancy now and next, the End of Days */
.app-uprising { display: grid; gap: .8rem; margin: .6rem 0 1rem; }
.app-ascline { margin: 0; font-family: var(--label); font-size: 1.2rem; }
.app-eod { background: var(--panel); padding: .6rem .9rem; border-left: 4px solid var(--sodium); }
.app-eod h3 { margin: 0 0 .3rem; }
.app-eod p { margin: 0; }
.eod-yes { color: var(--sodium); }
.app-lastcycle { margin: 0; }

/* Train: a fighter the XP would take over an advancement threshold */
.app-trainnote { margin: .3rem 0 0; font-family: var(--label); color: var(--muted); }
.app-trainnote.adv { color: var(--sodium); }
select.act-adv { border-color: var(--sodium); box-shadow: 0 0 0 1px var(--sodium); }
tr.app-willadvance td { background: color-mix(in srgb, var(--sodium) 10%, transparent); }

/* Territory cards, laid out like the book's: the Benefits, a shaded Ruined block, the Battlefield Effect */
.app-trange { color: var(--muted); font-family: var(--label); letter-spacing: .06em; }
.app-tline { margin: .35rem 0; }
.app-tline b { font-family: var(--label); }
.app-truined { background: var(--panel-2); padding: .4rem .7rem .5rem; margin: .5rem 0; }
.app-teffect { border-left: 3px solid var(--tone, var(--line)); padding-left: .7rem; margin: .5rem 0 0; }
.app-truined h4, .app-teffect h4 { margin: 0 0 .15rem; font-family: var(--label); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.app-teffect p { margin: 0; }
.app-rolldlg .app-useDice { margin-left: auto; align-self: flex-end; }
.app-rolldlg .app-rolldice:has(.app-useDice) { flex-wrap: nowrap; gap: .5rem; }
.app-rolldlg .app-rolldice:has(.app-useDice) .pe-f { width: 4rem; }
.app-rolldlg .app-rolldice:has(.app-useDice) .app-rollval { min-width: 0; font-size: 1.25rem; }
.app-rolldlg .app-useDice { flex: none; min-width: 0; padding-inline: .5rem; white-space: nowrap; }
