/* Today's artist panel (#60): one locked type system and one spacing rhythm, a bigger box, the Undo toast (#59).
   Type:   Libre Caslon Text 400 for the artist's name only (the one heading here).
           Inter for everything else, in three roles and no others:
             label  - 600 12/16, tracked .14em, small caps: Pack progress, Your message, links, status, "1 of 10", history
             body   - 500 16/24: handle, followers, genre line, the message, notes
             button - 600 15/1: every .btn (red = the one main action, bone = confirm, ghost = secondary)
   Space:  8px grid (8 / 16 / 24 / 32 / 40). Scoped to .pinfo.ap (artistPanel in app.js), so the pack hub is untouched.
   The card face itself (text on the card) is cards-mtg.css, not this file. */

.panel:has(> .pinfo.ap) {
  --ap-gap: 40px;
  width: min(1200px, 100%);
  padding: 32px;
  column-gap: var(--ap-gap);
  align-items: stretch;
}
/* #80 the glide between artists (app.js slidePanel): the panel holds its height while you page (--ap-hold, it only
   grows) and is the frame the old artist's snapshot is laid over; the snapshot is frozen as it was (no idle sway) */
#panel { position: relative; }
.panel:has(> .pinfo.ap) { min-height: var(--ap-hold, 0px); }
.glide-ghost { pointer-events: none; z-index: 1; }
.glide-ghost, .glide-ghost *, .glide-ghost *::before, .glide-ghost *::after { animation: none !important; transition: none !important; }
.panel:has(> .pinfo.ap) > .pcard { height: clamp(340px, min(64vh, 42vw), 620px); align-self: center; }

/* ---------- the three type roles ---------- */
.pinfo.ap {
  container: ap / inline-size;
  padding: 0;
  font: 500 16px/24px var(--sans);
  color: var(--bone);
  letter-spacing: 0;
}
.pinfo.ap .ap-label,
.pinfo.ap .textlink,
.pinfo.ap .artist-history summary,
.pinfo.ap .artist-history li {
  font: 600 13px/16px var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bone-2);
}
.pinfo.ap .ap-strong { color: var(--bone); font-variant-numeric: tabular-nums; }
.pinfo.ap .btn {
  min-height: 48px;
  padding: 0 24px;
  font: 600 16px/1 var(--sans);
  letter-spacing: .01em;
  text-transform: none;
}
.pinfo.ap .btn svg { width: 16px; height: 16px; }

/* links: the label style, a 32px hit area, brighter on hover */
.pinfo.ap .textlink {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 8px; border-radius: 6px;
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
@media (hover: hover) and (pointer: fine) {
  .pinfo.ap .textlink:hover { color: #fff; background: rgba(236, 228, 216, .06); text-decoration: none; }
}
.pinfo.ap .ap-links { display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: -8px; }

/* ---------- rows, top to bottom, on the 8px grid ---------- */
.pinfo.ap .ap-top {
  display: flex; align-items: center; gap: 16px; min-height: 32px;
  padding-bottom: 16px; margin-bottom: 24px; border-bottom: 1px solid var(--line);
}
.pinfo.ap .ap-top { position: relative; white-space: nowrap; }
/* pack progress fills the rule under the top row, in oxblood */
.pinfo.ap .ap-meter { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; }
.pinfo.ap .ap-meter i { display: block; height: 100%; background: linear-gradient(90deg, #7c1720, var(--red-hi)); transform-origin: left; }

.pinfo.ap .phead { display: block; }
.pinfo.ap .phead h2 {
  margin: 0; font: 400 clamp(44px, 4.4vw, 68px)/1.05 var(--serif); letter-spacing: -.01em; color: #fff;
  text-wrap: balance;
}
.pinfo.ap .ap-meta, .pinfo.ap .ap-sub { margin: 0; display: flex; flex-wrap: wrap; align-items: center; }
.pinfo.ap .ap-meta { margin-top: 16px; }
.pinfo.ap .ap-meta a { color: var(--bone); text-decoration: none; text-underline-offset: 4px; }
.pinfo.ap .ap-meta a:hover { text-decoration: underline; text-decoration-color: rgba(236, 228, 216, .4); }
.pinfo.ap .ap-meta b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.pinfo.ap .ap-sub { color: var(--bone-2); }
.pinfo.ap .ap-sub .tierword { color: var(--c); font-weight: 600; }
.pinfo.ap .ap-dot { width: 3px; height: 3px; margin: 0 8px; border-radius: 50%; background: var(--bone-3); }

.pinfo.ap .ap-msg-head { display: flex; align-items: center; gap: 16px; min-height: 32px; margin: 32px 0 8px; white-space: nowrap; }
.pinfo.ap .ap-msg-head label { cursor: text; }
.pinfo.ap .msgbox textarea {
  min-height: 104px; max-height: 192px; padding: 16px 16px 32px;
  font: 500 16px/24px var(--sans); letter-spacing: 0; color: var(--bone);
}
.pinfo.ap .msgbox .count { right: 16px; bottom: 8px; color: var(--bone-3); letter-spacing: .08em; }
.pinfo.ap .why { margin: 16px 0 0; gap: 8px; font: 500 16px/24px var(--sans); color: var(--bone-2); }
.pinfo.ap .why b { margin-right: 8px; font: 600 13px/16px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--bone); }

.pinfo.ap .ap-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.pinfo.ap .ap-acts .btn { flex: 0 0 auto; padding: 0 24px; }
.pinfo.ap .ap-acts .btn:first-child { flex: 1 1 auto; }
.pinfo.ap .pnote { margin: 16px 0 0; font: 500 16px/24px var(--sans); color: var(--bone-2); max-width: 40em; }

.pinfo.ap .ap-history { margin-top: 16px; }
.pinfo.ap .ap-history .call-actions { margin-bottom: 8px; }
.pinfo.ap .artist-history { margin: 0; }
.pinfo.ap .artist-history summary { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.pinfo.ap .artist-history summary:hover { color: #fff; }
.pinfo.ap .artist-history summary { list-style: none; }
.pinfo.ap .artist-history summary::-webkit-details-marker { display: none; }
.pinfo.ap .artist-history summary::before { /* a small chevron: points right closed, down open */
  content: ""; width: 5px; height: 5px; margin: 0 4px 2px 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform var(--dur-fast) var(--ease); }
.pinfo.ap .artist-history[open] summary::before { transform: rotate(45deg); margin-bottom: 4px; }
.pinfo.ap .artist-history ol { margin: 8px 0 0; }
.pinfo.ap .artist-history li { gap: 16px; padding: 8px 0; }
.pinfo.ap .artist-history p { margin: 8px 0 0; font: 500 13px/16px var(--sans); color: var(--bone-3); }

.pinfo.ap .ap-foot {
  display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 16px;
  border-top: 1px solid var(--line); font: inherit;
}
.pinfo.ap .ap-foot > .ap-label { margin-right: 8px; }
.pinfo.ap .ap-foot .pager { display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: -8px; }
.pinfo.ap .ap-foot .pager span { margin: 0; min-width: 64px; text-align: center; }
/* at least one 24px step above the foot; the foot's auto margin takes any extra height */
.pinfo.ap .ap-history { margin-bottom: 24px; }

/* ---------- smaller screens ---------- */
/* a narrow info column (1024, phones): the progress rule says "pack progress" on its own; the two buttons stack */
@container ap (max-width: 520px) {
  .ap-top > .ap-word { display: none; }
  .ap-acts { flex-direction: column; }
  .ap-acts .btn { width: 100%; }
}
@media (max-width: 1180px) {
  .panel:has(> .pinfo.ap) { --ap-gap: 32px; padding: 24px; }
}
@media (max-height: 800px) and (min-width: 861px) {
  .pinfo.ap .ap-msg-head { margin-top: 24px; }
  .pinfo.ap .phead h2 { font-size: clamp(40px, 4vw, 60px); }
}
@media (max-width: 860px) {
  .panel:has(> .pinfo.ap) { padding: 24px; row-gap: 32px; }
  .panel:has(> .pinfo.ap) > .pcard { height: clamp(320px, 50vh, 440px); }
  .pinfo.ap .ap-acts { flex-direction: column; }
  .pinfo.ap .ap-acts .btn { width: 100%; }
}
@media (max-width: 440px) {
  .panel:has(> .pinfo.ap) { padding: 24px 16px; }
  .pinfo.ap .phead h2 { font-size: 44px; }
  .pinfo.ap .ap-top [data-go="artists"] { display: none; } /* Artists sits right above in the top menu */
  .pinfo.ap .ap-msg-head { gap: 8px; }
  .pinfo.ap .ap-msg-head .ap-links { gap: 0; margin-right: -6px; }
  .pinfo.ap .ap-msg-head .textlink { padding: 0 6px; letter-spacing: .06em; }
}

/* ---------- the Undo toast (#59), bottom centre, near the panel ---------- */
.ap-toast { position: fixed; left: 50%; bottom: 32px; z-index: 72; transform: translateX(-50%); pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.ap-toast-in {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 8px 24px;
  border-radius: var(--r-lg); background: var(--grain) 0 0 / 160px, var(--surface-solid); box-shadow: var(--edge-hi), 0 16px 48px rgba(0, 0, 0, .55);
  font: 500 16px/24px var(--sans); color: var(--bone); text-shadow: none;
  opacity: 0; transform: translateY(6px) scale(.98);
  transition: opacity 160ms ease, transform 160ms var(--ease);
}
.ap-toast-in.has-undo { padding-right: 8px; }
.ap-toast.on .ap-toast-in { opacity: 1; transform: none; pointer-events: auto; transition: opacity 220ms ease, transform 320ms var(--ease); }
@starting-style { .ap-toast.on .ap-toast-in { opacity: 0; transform: translateY(12px) scale(.98); } }
.ap-toast-undo {
  min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-md); cursor: pointer;
  background: rgba(236, 228, 216, .1); box-shadow: inset 0 0 0 1px var(--line-hi); color: #fff;
  font: 600 16px/1 var(--sans); letter-spacing: .01em;
  transition: background-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) { .ap-toast-undo:hover { background: rgba(236, 228, 216, .18); } }
.ap-toast-undo:active { transform: scale(.97); }
.ap-toast-time { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--red-hi); opacity: .8; transform-origin: left; animation: ap-time var(--ms, 6000ms) linear forwards; }
.ap-toast.paused .ap-toast-time { animation-play-state: paused; }
@keyframes ap-time { from { transform: scaleX(1); } to { transform: scaleX(0); } }
/* a card held up close (#inspect, z 45) keeps its Flip / Close buttons clear: the toast steps aside (Ctrl+Z still undoes) */
body:has(#inspect:not([hidden])) .ap-toast { visibility: hidden; }
@media (max-width: 600px) { .ap-toast { bottom: 16px; } .ap-toast-in { gap: 8px; padding-left: 16px; } }
@media (prefers-reduced-motion: reduce) { .ap-toast-in, .ap-toast.on .ap-toast-in { transform: none; } }

/* #123 honest locks: without the installation "They replied" (and "Log call booked") wear a small gold lock and open the
   upgrade sheet; one line under the buttons says why. The button stays a button (it does something: the sheet). */
.btn.is-locked { color: var(--bone-2); }
.btn.is-locked .ap-lock-ic { display: inline-grid; place-items: center; }
.btn.is-locked .ap-lock-ic svg { width: 15px; height: 15px; fill: none; stroke: var(--t-titan); stroke-width: 1.8; }
@media (hover: hover) and (pointer: fine) { .btn.is-locked:hover { color: var(--bone); } }
.pinfo.ap .pnote.ap-lock { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; font-size: 15px; line-height: 22px; color: var(--bone-3); }
.pinfo.ap .pnote.ap-lock > svg { flex: none; width: 15px; height: 15px; margin-top: 3px; fill: none; stroke: var(--t-titan); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pinfo.ap .pnote.ap-lock .textlink { min-height: 0; padding: 0; font-size: 13.5px; color: #f0d9a8; }
