/* Author stack in the chart tile header: the 2D paper deck of the approved prototype
   (docs/designs/author-stack-prototype-2026-10-15.html). Disc 18 px + 1.5 px gap + 1.5 px
   ring = 24 px, inside the 25/29 px header. On = hue ring; off = the same picture as grey
   paper. Collapsed: the front card leftmost, each next one 11 px behind it. */
/* --author-long/short live on .author-signals (the panel); the tile header is outside it. */
.author-stack {--stack-head:var(--monitor-neutral-0c1118,#0c1118);--author-long:#26a69a;--author-short:#ef5350;--stack-ease:cubic-bezier(.2,.7,.2,1);
  position:relative;flex:0 1 auto;align-self:stretch;min-width:24px;max-width:100%;display:flex;align-items:center;color:var(--monitor-text);}
.author-stack[hidden] {display:none;}
.monitor-widget__head .author-stack button {appearance:none;-webkit-appearance:none;margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation;}
.author-stack__row {position:relative;display:flex;align-items:center;height:100%;flex:none;}

/* one card */
.monitor-widget__head .author-stack .author-stack__card {position:relative;flex:none;display:inline-flex;align-items:center;width:18px;height:18px;margin-left:-7px;}
.author-stack__card:first-child {margin-left:0!important;}
.author-stack :is(.author-stack__card,.author-stack__history)::before {content:"";position:absolute;inset:-7px;}
.author-stack .author-stack__history::before {inset:-6px;} /* 20 px square + 6 px = 32 px */ /* hit area ≥ 32 px */
.author-stack__disc {position:relative;flex:none;display:grid;place-items:center;width:18px;height:18px;border-radius:50%;}
.author-stack .author-avatar {width:18px;height:18px;font-size:7px;font-weight:700;box-shadow:0 0 0 1.5px var(--stack-head);transition:box-shadow 220ms var(--stack-ease);}
.author-stack .author-avatar > * {transition:filter 220ms;}
.author-stack .author-avatar img {display:block;}
.author-stack__card[data-on="true"] .author-avatar {box-shadow:0 0 0 1.5px var(--stack-head),0 0 0 3px hsl(var(--author-hue) 75% 62% / .9);}
.author-stack__card[data-history="true"] .author-avatar {box-shadow:0 0 0 1.5px var(--stack-head);outline:1.5px dashed hsl(var(--author-hue) 70% 70% / .9);outline-offset:1.5px;}
.author-stack__card[data-on="false"] .author-avatar > * {filter:grayscale(1) brightness(.8);}
.author-stack__card[data-on="false"] .author-avatar {background:linear-gradient(140deg,#7d8593,#555c68);}
.author-stack__card[data-on="false"] .author-stack__disc::after {content:"";position:absolute;inset:0;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.25);pointer-events:none;}
.workstation-frame[data-theme="light"] .author-stack__card[data-on="false"] .author-avatar > * {filter:grayscale(1) brightness(1.06);}
.workstation-frame[data-theme="light"] .author-stack__card[data-on="false"] .author-stack__disc::after {box-shadow:inset 0 0 0 1px rgba(0,0,0,.12);}
.author-stack__card[data-locked="true"] .author-avatar > * {filter:saturate(.35) blur(.4px);}
.author-stack__card[data-locked="true"][data-on="false"] .author-avatar > * {filter:grayscale(1) brightness(.8) blur(.4px);}
.author-stack__card:focus-visible {outline:none!important;}
.author-stack__card:focus-visible .author-avatar {outline:2px solid var(--workstation-accent);outline-offset:1px;}
/* long/short dot in the lower-right corner; 🔒 for a locked author */
.author-stack__dot {position:absolute;right:-1.5px;bottom:-1.5px;z-index:1;width:7px;height:7px;border-radius:50%;background:var(--author-long);box-shadow:0 0 0 1.5px var(--stack-head);}
.author-stack__dot[data-side="short"] {background:var(--author-short);}
.author-stack__lock {position:absolute;right:-3px;bottom:-3px;z-index:1;display:grid;place-items:center;width:10px;height:10px;border-radius:50%;background:var(--stack-head);font:normal 6.5px/1 sans-serif;}

/* collapsed deck: leftmost on top; off cards keep the fan grey treatment; front ring only */
.author-stack[data-expanded="false"] .author-stack__card:nth-child(1) {z-index:5;}
.author-stack[data-expanded="false"] .author-stack__card:nth-child(2) {z-index:4;}
.author-stack[data-expanded="false"] .author-stack__card:nth-child(3) {z-index:3;}
.author-stack[data-expanded="false"] .author-stack__card:nth-child(n+2) .author-avatar,
.author-stack[data-expanded="false"] .author-stack__card[data-on="false"] .author-avatar {box-shadow:0 0 0 1.5px var(--stack-head);outline:0;}
.author-stack[data-expanded="false"] .author-stack__card:not(:first-child) .author-stack__dot {display:none;}
.author-stack[data-expanded="false"] .author-stack__card:nth-child(n+4) {position:absolute;left:22px;opacity:0;scale:.4;pointer-events:none;}
.monitor-widget__head .author-stack[data-expanded="false"] :is(.author-stack__name,.author-stack__history) {display:none;}
.author-stack__more {flex:none;margin-left:4px;font-size:9.5px;font-weight:700;color:var(--monitor-muted);white-space:nowrap;transition:opacity 130ms ease-out;}
.author-stack__more:empty {display:none;}
.monitor-widget__head .author-stack .author-stack__deck {position:absolute;inset:0 -4px;z-index:30;border-radius:12px;}
.author-stack__solo {display:none;margin-left:6px;font-size:11.5px;white-space:nowrap;color:var(--monitor-text);}
.author-stack__solo:empty {display:none!important;}
.author-stack__solo i {font-style:normal;font-weight:800;font-size:9.5px;letter-spacing:.04em;color:var(--author-long);}
.author-stack__solo i[data-side="short"] {color:var(--author-short);}
.author-stack__solo small {font-size:10.5px;color:var(--monitor-muted);}

/* fanned row: dealt from behind the front card, 9 px apart; a name beside each disc on a tile ≥ 560 px */
.author-stack[data-expanded="true"] {flex:1;min-width:0;z-index:var(--z-chart-toolbar);}
.author-stack[data-expanded="true"] :is(.author-stack__deck,.author-stack__solo) {display:none;}
.author-stack[data-expanded="true"] .author-stack__more {position:absolute;right:0;opacity:0;pointer-events:none;}
.author-stack[data-expanded="true"] .author-stack__row {flex:0 1 auto;min-width:0;max-width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;overscroll-behavior-x:contain;padding-right:4px;}
.author-stack__row::-webkit-scrollbar {display:none;}
.monitor-widget__head .author-stack[data-expanded="true"] .author-stack__card {margin-left:9px;}
.author-stack[data-expanded="true"] .author-stack__card:first-child {margin-left:4px!important;}
.author-stack__name {display:none;margin-left:5px;font-size:11px;font-weight:600;white-space:nowrap;color:var(--monitor-text);}
.author-stack__card[data-on="false"] .author-stack__name {color:var(--monitor-muted);}
@container monitor-widget (min-width:560px) {
  .monitor-widget__head .author-stack[data-expanded="true"] .author-stack__card {width:auto;padding-right:4px;}
  .author-stack[data-expanded="true"] .author-stack__name {display:inline;}
  .author-stack[data-expanded="false"] .author-stack__solo {display:inline;}
}

/* «Следы» (history of every author that is on): a rounded square after a hairline, never a disc,
   so it never reads as one more author; only while fanned, no word at any width. */
.author-stack__divider {flex:none;width:1px;height:16px;margin-left:9px;background:var(--monitor-line-soft);}
.monitor-widget__head .author-stack .author-stack__history {position:relative;flex:none;display:inline-flex;align-items:center;margin-left:8px;}
.author-stack__history-square {display:grid;place-items:center;width:20px;height:20px;border-radius:5px;box-sizing:border-box;
  background:var(--monitor-panel-raised);color:var(--monitor-muted);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--monitor-muted) 45%,transparent);
  transition:background 220ms,color 220ms,box-shadow 220ms;}
.author-stack__history-square svg {display:block;}
.author-stack__history[aria-pressed="true"] .author-stack__history-square {color:var(--workstation-accent);
  background:color-mix(in srgb,var(--workstation-accent) 16%,var(--monitor-panel-raised));box-shadow:inset 0 0 0 1px var(--workstation-accent);}
.author-stack__history:disabled {opacity:.45;cursor:default!important;}
.author-stack__history:focus-visible {outline:none!important;}
.author-stack__history:focus-visible .author-stack__history-square {outline:2px solid var(--workstation-accent);outline-offset:1px;}
.monitor-widget__head .author-stack[data-expanded="false"] .author-stack__divider {display:none;}

/* A narrow tile (< 560 px) deals the same row without names: the caption chip names the card
   under the finger/focus or just toggled; ⠿ and ƒ＋ step aside while fanned (D9). */
@container monitor-widget (max-width:559px) {
  :is(.author-stack-fanned,.space-stack-fanned) .monitor-widget__head .indicator-add {display:none;}
  :is(.author-stack-fanned,.space-stack-fanned) .monitor-widget__head [data-monitor-drag-handle] {visibility:hidden;} /* keeps the ticker put */
  /* one fan at a time takes the header */
  .author-stack-fanned .monitor-widget__head [data-space-stack],
  .space-stack-fanned .monitor-widget__head [data-author-stack],
  .space-stack-fanned .monitor-widget__head [data-space-stack]::before {display:none;}
}
.author-stack__caption {position:absolute;z-index:42; /* over the chart’s + watchlist (41) */max-width:calc(100% - 12px);padding:2px 8px;border:1px solid var(--monitor-line-soft);border-radius:9px;
  background:var(--monitor-panel);color:var(--monitor-text);font-size:11px;font-weight:600;line-height:16px;white-space:nowrap;
  box-shadow:0 4px 14px rgba(0,0,0,.28);opacity:0;transition:opacity .2s;pointer-events:none;}
.author-stack__caption[data-show="true"] {opacity:1;}

/* hint strip at the chart's bottom */
.author-stack__hint {position:absolute;left:50%;bottom:28px;z-index:12;width:max-content;max-width:calc(100% - 16px);padding:3px 9px;transform:translateX(-50%);
  border:1px solid var(--monitor-line-soft);border-radius:9px;background:var(--monitor-panel);color:var(--monitor-muted);font-size:10.5px;line-height:1.35;text-align:center;
  opacity:0;transition:opacity .25s;pointer-events:none;}
.author-stack__hint[data-show="true"] {opacity:1;}

/* a dock arrival pulses the front card once */
@keyframes author-stack-arrival {
  0% {box-shadow:0 0 0 1.5px var(--stack-head),0 0 0 3px hsl(var(--author-hue) 75% 62% / .9),0 0 0 0 rgba(139,111,218,.7);}
  100% {box-shadow:0 0 0 1.5px var(--stack-head),0 0 0 3px hsl(var(--author-hue) 75% 62% / .9),0 0 0 10px rgba(139,111,218,0);}
}
.author-stack.is-arriving .author-stack__card:first-child .author-avatar {animation:author-stack-arrival 900ms ease-out 1;}
@media (prefers-reduced-motion:reduce) {.author-stack *,.author-stack__hint,.author-stack__caption {animation-duration:0s!important;transition-duration:0s!important;}}

:is(.author-stack-horizontal,.space-stack-horizontal) .monitor-widget__head-spacer,
.workstation-frame[data-mode="monitor"] :is(.author-stack-horizontal,.space-stack-horizontal) .monitor-widget__head-spacer {flex:0 0 0;min-width:0;width:0;}

/* D8: the shared-space deck is this deck (space_stack.js); a hairline parts it from the
   authors only when both show — never right after ƒ＋. */
[data-author-stack]:not([hidden]) + [data-space-stack]:not([hidden])::before {content:"";flex:none;width:1px;height:16px;margin:0 9px 0 5px;background:var(--monitor-line-soft);}

.author-signal-frost {position:absolute;inset:0 60px 25px 0;z-index:4;pointer-events:none;border-left:1px solid rgba(181,154,247,.28);background:linear-gradient(160deg,rgba(139,111,218,.16),rgba(13,17,24,.32) 55%,rgba(13,17,24,.5));backdrop-filter:blur(2px);}
.author-signal-frost::before {content:'';position:absolute;inset:20% 0;background:repeating-linear-gradient(173deg,transparent 0 32px,rgba(181,154,247,.35) 34px 35px,transparent 38px 60px);filter:blur(3px);}
.author-signal-frost__chips {position:absolute;top:var(--frost-top,48px);right:6px;display:flex;flex-direction:column;align-items:flex-end;gap:4px;max-width:var(--frost-room,320px);}
.author-signal-frost__chip,.author-signal-frost__more {display:inline-flex;align-items:center;gap:3px;max-width:100%;min-width:0;padding:3px 8px;border:1px solid rgba(181,154,247,.4);border-radius:999px;background:var(--monitor-panel);color:var(--monitor-text);font-size:11px;line-height:16px;white-space:nowrap;text-decoration:none;pointer-events:auto;box-shadow:0 2px 8px rgba(0,0,0,.25);}
.author-signal-frost__chip b {min-width:24px;overflow:hidden;text-overflow:ellipsis;font-weight:650;}
.author-signal-frost__chip span {flex:none;color:var(--monitor-muted);}
.author-signal-frost__chips[data-fit="short"] [data-part="days"],.author-signal-frost__chips[data-fit="min"] [data-part] {display:none;}
/* «🔒 N» alone (N from data-count), anchored 6 px from the tile's edge (the band stops 60 px short of it). */
.author-signal-frost__chips[data-fit="tiny"] {right:-54px;}
.author-signal-frost__chips[data-fit="tiny"] .author-signal-frost__chip > * {display:none;}
.author-signal-frost__chips[data-fit="tiny"] .author-signal-frost__chip::after {content:attr(data-count);}
.author-signal-frost__chips[data-fit="tiny"] .author-signal-frost__chip {padding-inline:6px;}
.author-signal-frost__chip:hover {border-color:var(--workstation-accent);}
.author-signal-frost__more {color:var(--monitor-muted);pointer-events:none;}
.workstation-frame[data-theme="light"] .author-signal-frost {border-color:rgba(107,79,209,.28);background:linear-gradient(160deg,rgba(139,111,218,.20),rgba(255,255,255,.4) 58%,rgba(246,243,255,.55));}

/* «Следы»: the tapped trade's card and the score strip, both at the chart's bottom (phone: a sheet). */
.author-signal-tooltip {white-space:pre-line;}
.author-trail-card,.author-trail-score {position:absolute;left:8px;bottom:34px;z-index:var(--z-chart-tooltip);box-sizing:border-box;
  max-width:calc(100% - 74px);border:1px solid var(--monitor-line-soft);border-radius:10px;background:var(--monitor-panel);color:var(--monitor-text);
  box-shadow:0 8px 24px rgba(0,0,0,.3);font-size:12px;line-height:1.35;}
.author-trail-card[hidden],.author-trail-score[hidden] {display:none;}
.author-trail-card {padding:9px 30px 9px 12px;}
.author-trail-card p {margin:0;overflow-wrap:anywhere;}
.author-trail-card__who i {font-style:normal;font-weight:800;font-size:11px;letter-spacing:.03em;color:var(--author-long,#26a69a);}
.author-trail-card__who i[data-side="short"] {color:var(--author-short,#ef5350);}
.author-trail-card__what {margin-top:2px!important;}
.author-trail-card__how {margin-top:2px!important;color:var(--monitor-muted);font-size:11px;}
.author-trail-card [data-tone="win"],.author-trail-score [data-tone="win"] {color:#2fbf71;}
.author-trail-card [data-tone="loss"],.author-trail-score [data-tone="loss"] {color:#ef5350;}
.author-trail-card__post,.author-trail-card__close {appearance:none;border:0;background:none;color:var(--workstation-accent);font:inherit;padding:0;cursor:pointer;}
.author-trail-card__post {min-height:24px;}
.author-trail-card__close {position:absolute;top:4px;right:6px;width:24px;height:24px;color:var(--monitor-muted);font-size:16px;}
.author-trail-score {display:flex;flex-wrap:wrap;gap:4px 12px;padding:5px 10px;font-size:11px;pointer-events:none;}
.author-trail-score i {font-style:normal;font-weight:700;}
.author-trail-score__row {overflow-wrap:anywhere;}
@container monitor-widget (max-width:420px) {.author-trail-card,.author-trail-score {left:6px;right:66px;max-width:none;}}
