/* Keep the hit area aligned with the toolbar and the seal aligned with its icons. */
:root button.anomaly-entry {
  order: 99;
  position: relative;
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0 0 1px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted, #6a7961);
  font: 500 14px/1 "Songti SC", STSong, "Noto Serif CJK SC", serif;
  cursor: pointer;
  vertical-align: middle;
  transition: color .15s;
}
:root button.anomaly-entry::before {
  content: "";
  position: absolute;
  inset: 4px;
  box-sizing: border-box;
  border: 1px solid currentColor;
  border-radius: 2px 3px;
  /* Leave a small break in the top edge of the seal. */
  clip-path: polygon(0 0, calc(100% - 6px) 0, calc(100% - 6px) 1px,
    calc(100% - 3px) 1px, calc(100% - 3px) 0, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}
:root button.anomaly-entry:hover,
:root button.anomaly-entry:focus-visible {
  color: var(--text, #435e43);
  background: transparent;
}
:root button.anomaly-entry:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
:root button.anomaly-entry[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  :root button.anomaly-entry { transition: none; }
}
.anomaly-popup{--an-paper:var(--panel,#faf9f2);--an-ink:var(--text,#344439);--an-muted:var(--muted,#76816f);--an-line:var(--line,#dce2d2);--an-moss:#637c55;--an-red:#c4473d;--an-down:#397763;--an-soft:#edf1e5;box-sizing:border-box;width:min(420px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:20px;border:1px solid var(--an-line);border-radius:12px;background:var(--an-paper);color:var(--an-ink);box-shadow:0 14px 48px #25332130;font:14px/1.55 -apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif;font-variant-numeric:tabular-nums}
.anomaly-popup::backdrop{background:#273a2a50;backdrop-filter:blur(3px)}
.anomaly-popup [hidden]{display:none!important}.anomaly-popup p,.anomaly-popup h2,.anomaly-popup h3{margin:0}
.anomaly-popup button{font:inherit;color:inherit;background:transparent;border:1px solid var(--an-line);border-radius:5px;cursor:pointer;padding:4px 8px}.anomaly-popup button:disabled{opacity:.5;cursor:wait}.anomaly-popup button:focus-visible,.anomaly-popup summary:focus-visible{outline:2px solid var(--an-moss);outline-offset:3px}
.anomaly-heading,.anomaly-heading>div,.anomaly-identity,.anomaly-quote,.anomaly-period header,.anomaly-threshold,.anomaly-price,.anomaly-band-meta,.anomaly-chart-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.anomaly-heading{justify-content:space-between;color:var(--an-moss);font-size:12px;letter-spacing:2px}.anomaly-heading>div{gap:4px}.anomaly-heading button{border-color:transparent;display:grid;place-items:center;padding:4px}.anomaly-heading button:hover{background:var(--an-soft)}.anomaly-heading svg{width:17px;height:17px}
.anomaly-identity{margin-top:10px;align-items:baseline;gap:12px}.anomaly-popup h2{font:500 26px/1.4 'Songti SC',STSong,serif;letter-spacing:1px}.anomaly-code{color:var(--an-muted);font-size:12px}
.anomaly-meta{color:var(--an-muted);font-size:12px;margin-top:2px!important}
.anomaly-quote{margin-top:12px;gap:10px}.anomaly-quote>strong{font-size:25px;font-weight:500}.anomaly-change{font:500 21px/1.3 Georgia,'Times New Roman',serif}
.anomaly-popup [data-direction=up]{color:var(--an-red)}.anomaly-popup [data-direction=down]{color:var(--an-down)}
.anomaly-popup .anomaly-chart-toggle{margin-left:auto;display:flex;align-items:center;gap:6px;padding:6px 9px;background:var(--an-soft);color:var(--an-moss);font-size:13px}.anomaly-chart-toggle svg{width:16px;height:16px}.anomaly-popup .anomaly-chart-toggle[aria-expanded=true]{background:var(--an-moss);color:var(--an-paper);border-color:var(--an-moss)}
.anomaly-results{margin-top:12px}.anomaly-period{padding-top:12px;margin-top:12px;border-top:1px solid var(--an-line)}.anomaly-period header,.anomaly-threshold,.anomaly-price,.anomaly-band-meta{justify-content:space-between}.anomaly-popup h3{font:500 20px/1.4 'Songti SC',STSong,serif}.anomaly-badge{font-size:12px;background:var(--an-soft);color:var(--an-moss);border-radius:4px;padding:2px 6px}.anomaly-period[data-hit=true] .anomaly-badge{color:var(--an-red);background:color-mix(in srgb,var(--an-red) 10%,var(--an-paper))}
.anomaly-threshold{margin-top:8px}.anomaly-threshold>span,.anomaly-price>span{color:var(--an-muted);font-size:13px}.anomaly-threshold strong{font:500 30px/1.3 Georgia,'Times New Roman',serif;letter-spacing:-.04em}.anomaly-price{margin-top:3px}.anomaly-price strong{font:500 21px/1.4 Georgia,'Songti SC',serif}.anomaly-band-meta{margin-top:8px;color:var(--an-muted);font-size:12px}.anomaly-band-meta b{font-weight:400}.anomaly-error{margin-top:10px!important;color:var(--an-muted)}
.anomaly-method{border-top:1px solid var(--an-line);margin-top:14px;padding-top:10px;font-size:12px;color:var(--an-muted)}.anomaly-method summary{cursor:pointer}.anomaly-method p{margin-top:8px;line-height:1.8}
.anomaly-intraday{border-top:1px solid var(--an-line);padding-top:12px;margin-top:12px}.anomaly-chart-head{justify-content:space-between}.anomaly-chart-head small{font-size:12px;color:var(--an-muted)}.anomaly-chart-legend{display:flex;gap:6px 14px;flex-wrap:wrap;color:var(--an-red);font-size:12px;margin-top:8px}.anomaly-chart-legend span:before{content:'';display:inline-block;width:18px;border-top:1.5px dashed currentColor;margin-right:5px;vertical-align:middle}.anomaly-chart-legend span[data-days='30']:before{border-top-style:dotted}.anomaly-chart-state{font-size:12px;color:var(--an-muted);margin-top:7px!important}.anomaly-chart{display:block;width:100%;height:254px;margin-top:4px;overflow:visible}.anomaly-chart-note{font-size:12px;color:var(--an-muted);line-height:1.6}
:root[data-theme=dark] .anomaly-popup{--an-moss:#b1c49f;--an-red:#ee8276;--an-down:#7bc5a9;--an-soft:#303b2c}
@media(max-width:360px){.anomaly-popup{padding:16px}.anomaly-quote{gap:7px}.anomaly-quote>strong{font-size:22px}.anomaly-change{font-size:18px}.anomaly-popup .anomaly-chart-toggle{padding:6px}.anomaly-threshold strong{font-size:27px}}
@media(pointer:coarse){.anomaly-heading button{min-width:32px;min-height:36px}.anomaly-popup .anomaly-chart-toggle{min-height:36px}}
