/* Chart patterns (patterns.js): company report section and the /patterns page. */
:root{--pt-up:#0f9d7a;--pt-up-soft:rgba(15,157,122,.12);--pt-down:#d4553f;--pt-down-soft:rgba(212,85,63,.12);--pt-amber:#b56510;--pt-amber-soft:rgba(224,137,42,.14);
  --pt-ink:var(--ink,#171c23);--pt-muted:var(--muted,#596370);--pt-line:var(--line,#dfe3e8);--pt-card:#fff;--pt-tile:#f1f3f5;--pt-accent:#4d5bd6;
  --pt-ease:cubic-bezier(.16,1,.3,1);--pt-spring:cubic-bezier(.34,1.45,.55,1)}
.report-patterns{margin:28px 0;display:grid;gap:16px}
.report-patterns[hidden],.pt-page [hidden]{display:none}
.pt-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;flex-wrap:wrap}
.pt-head h2{margin:4px 0 0;font-size:clamp(20px,2.4vw,26px);letter-spacing:-.02em}
.pt-kicker{font:700 11px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.16em;color:var(--pt-muted)}
.pt-status{display:inline-flex;align-items:center;gap:8px;padding:7px 12px;border-radius:999px;border:1px solid var(--pt-line);background:var(--pt-card);font:600 12px/1 ui-monospace,Menlo,monospace;color:var(--pt-muted);white-space:nowrap}
.pt-status.is-live{color:#0b6e61;border-color:rgba(15,157,122,.35);background:rgba(15,157,122,.07)}
.pt-status.is-live .pt-pulse{background:var(--pt-up);animation-name:pt-pulse-live}
@keyframes pt-pulse-live{0%{box-shadow:0 0 0 0 rgba(15,157,122,.5)}70%{box-shadow:0 0 0 9px rgba(15,157,122,0)}100%{box-shadow:0 0 0 0 rgba(15,157,122,0)}}
.pt-status-sub{display:block;margin-top:6px;font-size:11.5px;color:var(--pt-muted);text-align:right}
.pt-live-note{margin:0;padding:10px 14px;border-radius:12px;background:var(--pt-amber-soft);font-size:12.5px;line-height:1.5;color:#7a4a0b}
.pt-pulse{width:8px;height:8px;border-radius:50%;background:var(--pt-accent);animation:pt-pulse 2.2s infinite}
@keyframes pt-pulse{0%{box-shadow:0 0 0 0 rgba(77,91,214,.45)}70%{box-shadow:0 0 0 9px rgba(77,91,214,0)}100%{box-shadow:0 0 0 0 rgba(77,91,214,0)}}
.pt-card{background:var(--pt-card);border:1px solid var(--pt-line);border-radius:18px;padding:18px;min-width:0;display:grid;gap:14px;align-content:start}
.pt-card-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;flex-wrap:wrap}
.pt-card-head h3{margin:0;font-size:15px}
.pt-card-head>span{font-size:12px;color:var(--pt-muted)}
.pt-small{margin:0;font-size:12.5px;line-height:1.5;color:var(--pt-muted)}
.pt-note{margin:0;font-size:12.5px;color:var(--pt-muted);max-width:86ch;line-height:1.55}
.pt-note a,.pt-small a{color:inherit;font-weight:600}
.t-up{color:var(--pt-up)}.t-down{color:var(--pt-down)}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* chips */
.pt-dir,.pt-verdict{display:inline-flex;align-items:center;padding:4px 9px;border-radius:999px;font:700 11px/1.1 system-ui,sans-serif;white-space:nowrap}
.pt-dir.pt-up{background:var(--pt-up-soft);color:#0b7a5f}.pt-dir.pt-down{background:var(--pt-down-soft);color:#b0402d}.pt-dir.pt-flat{background:var(--pt-tile);color:var(--pt-muted)}
.pt-verdict{justify-self:start}
.pt-v-edge{background:var(--pt-up);color:#fff}.pt-v-opp{background:var(--pt-amber-soft);color:var(--pt-amber)}.pt-v-none{background:var(--pt-tile);color:var(--pt-muted)}
.pt-rec{font-size:12px;color:var(--pt-muted);line-height:1.35}
.pt-rec b{font-variant-numeric:tabular-nums}
/* glyphs: a small drawing of the pattern; lines draw in when it appears */
.pt-glyph{width:64px;height:40px;display:block;overflow:visible;flex:none}
.pt-glyph.is-big{width:112px;height:70px}
.pt-glyph polyline,.pt-glyph path,.pt-glyph line{fill:none;stroke-linecap:round;stroke-linejoin:round}
.pt-glyph .g-px{stroke:var(--pt-ink);stroke-width:2.2}
.pt-glyph .g-out{stroke:var(--pt-accent)}
.pt-glyph .g-osc{stroke:var(--pt-accent);stroke-width:1.8}
.pt-glyph .g-ln{stroke:var(--pt-accent);stroke-width:1.4;stroke-dasharray:3 3}
.pt-glyph .g-neck,.pt-glyph .g-level{stroke:var(--pt-amber);stroke-dasharray:4 3}
.pt-glyph .g-band{stroke:#9aa7b4;stroke-dasharray:none;stroke-width:1.2}
.pt-glyph .g-zero{stroke:#c6ccd3;stroke-dasharray:none}
.pt-glyph .g-gap{stroke:var(--pt-accent);stroke-dasharray:2 2}
.pt-glyph .g-arrow{stroke:var(--pt-accent);stroke-width:2;fill:none}
.pt-glyph .g-c line{stroke-width:1.4}
.pt-glyph .g-c-up line,.pt-glyph .g-c-up rect{stroke:var(--pt-up);fill:var(--pt-up)}
.pt-glyph .g-c-dn line,.pt-glyph .g-c-dn rect{stroke:var(--pt-down);fill:var(--pt-down)}
.pt-glyph .g-vol{fill:#cfd5dc}.pt-glyph .g-vol-hi{fill:var(--pt-up)}.pt-glyph .g-vol-lo{fill:var(--pt-down)}
.pt-in .pt-glyph .g-px,.pt-in .pt-glyph .g-ln:not(.g-band),.pt-glyph.is-big .g-px{stroke-dasharray:100;animation:pt-draw 1.1s var(--pt-ease) both;animation-delay:calc(var(--i,0) * 40ms + .1s)}
.pt-in .pt-glyph .g-ln.g-neck,.pt-in .pt-glyph .g-ln.g-level{stroke-dasharray:4 3;animation:pt-fade .6s ease both;animation-delay:calc(var(--i,0) * 40ms + .6s)}
.pt-in .pt-glyph .g-c,.pt-in .pt-glyph .g-vol{transform-box:fill-box;transform-origin:bottom;animation:pt-grow .6s var(--pt-spring) both;animation-delay:calc(var(--i,0) * 40ms + .1s)}
@keyframes pt-draw{from{stroke-dashoffset:100}to{stroke-dashoffset:0}}
@keyframes pt-fade{from{opacity:0}}
@keyframes pt-grow{from{transform:scaleY(0)}}
/* chart */
.pt-chart-slot{min-width:0}
.pt-chart{display:block;max-width:100%;overflow:visible}
.pt-gridline{stroke:#eef0f3;stroke-width:1}
.pt-axis,.pt-tag{font:500 10.5px ui-monospace,Menlo,monospace;fill:var(--pt-muted)}
.pt-tag{fill:var(--pt-amber);font-weight:700}
.pt-candle line{stroke-width:1}
.pt-candle.is-up line,.pt-candle.is-up rect{stroke:var(--pt-up);fill:var(--pt-up)}
.pt-candle.is-down line,.pt-candle.is-down rect{stroke:var(--pt-down);fill:var(--pt-down)}
.pt-candle{opacity:.92}
.pt-mini-line{fill:none;stroke:var(--pt-ink);stroke-width:1.5;stroke-linejoin:round;opacity:.8}
.pt-line{fill:none;stroke:var(--pt-accent);stroke-width:2;stroke-dasharray:100;stroke-dashoffset:100;stroke-linecap:round}
.pt-level{stroke:var(--pt-amber);stroke-width:1.5;stroke-dasharray:6 4;opacity:0}
.pt-zone{fill:rgba(224,137,42,.14);stroke:rgba(224,137,42,.5);stroke-width:1;opacity:0}
.pt-box{fill:rgba(77,91,214,.08);stroke:rgba(77,91,214,.45);stroke-dasharray:4 3;opacity:0}
.pt-mark{fill:rgba(77,91,214,.1);stroke:rgba(77,91,214,.55);stroke-width:1.2;opacity:0}
.pt-point circle{fill:#fff;stroke:var(--pt-accent);stroke-width:2.2}
.pt-point text{font:700 11px system-ui,sans-serif;fill:var(--pt-accent)}
.pt-point{opacity:0;transform-box:fill-box;transform-origin:center}
.pt-draw .pt-line,.is-mini .pt-line{animation:pt-draw 1.1s var(--pt-ease) forwards .15s}
.pt-draw .pt-level,.pt-draw .pt-zone,.pt-draw .pt-box,.pt-draw .pt-mark,.is-mini .pt-level,.is-mini .pt-zone,.is-mini .pt-box{animation:pt-show .7s ease forwards .5s}
.pt-draw .pt-point{animation:pt-pop .5s var(--pt-spring) forwards;animation-delay:calc(var(--k) * 90ms + .7s)}
.pt-draw .pt-mark{animation:pt-show .5s ease forwards .2s,pt-glow 2.4s ease-in-out 1s infinite}
@keyframes pt-show{to{opacity:1}}
@keyframes pt-pop{from{opacity:0;transform:scale(.3)}to{opacity:1;transform:none}}
@keyframes pt-glow{50%{fill:rgba(77,91,214,.18)}}
.pt-chart-empty{padding:30px;text-align:center;color:var(--pt-muted);font-size:13px}
.pt-legend{display:flex;gap:16px;flex-wrap:wrap;font:500 11px/1 ui-monospace,Menlo,monospace;color:var(--pt-muted)}
.pt-legend i{display:inline-block;width:16px;height:3px;border-radius:2px;margin-right:6px;vertical-align:middle}
.pt-legend i.ln{background:var(--pt-accent)}.pt-legend i.lv{background:var(--pt-amber)}.pt-legend i.zn{background:rgba(224,137,42,.35);height:8px}
/* stock section */
.pt-stock{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:14px}
.pt-wide{grid-column:1/-1}
.report-patterns .pt-card{opacity:0;transform:translateY(12px);transition:opacity .6s var(--pt-ease),transform .7s var(--pt-ease)}
.report-patterns.pt-in .pt-card{opacity:1;transform:none}
.report-patterns.pt-in .pt-card:nth-child(2){transition-delay:.08s}.report-patterns.pt-in .pt-card:nth-child(3){transition-delay:.16s}
.pt-hits{display:grid;gap:6px;max-height:420px;overflow:auto;padding:2px}
.pt-hit{display:grid;grid-template-columns:52px minmax(0,1fr) auto;align-items:center;gap:10px;padding:8px 10px;border-radius:12px;border:1px solid transparent;background:none;text-align:left;cursor:pointer;color:inherit;font:inherit;transition:background .2s,border-color .2s,transform .3s var(--pt-ease)}
.pt-hit .pt-glyph{width:52px;height:32px}
.pt-hit b{display:block;font-size:13.5px}.pt-hit small{display:block;font-size:11.5px;color:var(--pt-muted);line-height:1.35;margin-top:2px}
.pt-hit:hover{background:#f6f8fa}
.pt-hit[aria-selected="true"]{background:#f1f2fd;border-color:rgba(77,91,214,.35)}
.pt-hit:focus-visible,.pt-pattern:focus-visible,.pt-spot-item:focus-visible,.pt-row:focus-visible,.pt-seg button:focus-visible{outline:2px solid var(--pt-accent);outline-offset:2px}
.pt-explain{display:grid;gap:14px}
.pt-explain-top{display:flex;gap:16px;align-items:center}
.pt-explain-top h3{margin:0 0 4px;font-size:17px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pt-explain-top p{margin:0;font-size:13.5px;color:var(--pt-muted);line-height:1.5}
.pt-explain-top .pt-detail{margin-top:4px;color:var(--pt-ink);font:500 12.5px/1.5 ui-monospace,Menlo,monospace}
.pt-track{display:grid;gap:10px;padding:14px;border-radius:14px;background:var(--pt-tile)}
.pt-track-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:12px;color:var(--pt-muted)}
.pt-track-nums{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.pt-track-nums b{display:block;font:800 22px/1.1 system-ui,sans-serif;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.pt-track-nums small{font-size:11.5px;color:var(--pt-muted)}
.pt-years{display:flex;gap:8px;align-items:flex-end;height:58px;padding-top:4px}
.pt-years span{flex:1;display:grid;grid-template-rows:1fr auto;height:100%;text-align:center}
.pt-years i{align-self:end;justify-self:center;width:70%;max-width:34px;height:var(--h);min-height:2px;border-radius:4px 4px 1px 1px;transform-origin:bottom;animation:pt-grow .8s var(--pt-spring) both}
.pt-years .is-up i{background:var(--pt-up)}.pt-years .is-down i{background:var(--pt-down)}
.pt-years small{font:600 10px ui-monospace,Menlo,monospace;color:var(--pt-muted);padding-top:3px}
.pt-quiet{justify-items:stretch}
/* empty, locked, loading */
.pt-empty{padding:26px;text-align:center;display:grid;gap:8px;justify-items:center}
.pt-empty h3{margin:0}.pt-empty p{margin:0;color:var(--pt-muted);max-width:56ch;line-height:1.5}
.pt-locked{position:relative;display:grid;place-items:center;border:1px dashed var(--pt-line);border-radius:18px;background:linear-gradient(180deg,#fbfcfd,#fff);overflow:hidden;min-height:220px}
.pt-locked>*{grid-area:1/1}
.pt-locked-art{display:flex;gap:28px;filter:blur(3px);opacity:.45}
.pt-locked .pt-empty{position:relative;z-index:1;background:rgba(255,255,255,.85);border-radius:16px;margin:16px}
.pt-skel{display:grid;gap:10px}
.pt-skel span{display:block;height:46px;border-radius:12px;background:linear-gradient(90deg,#eef0f3 0%,#f8f9fa 40%,#eef0f3 80%);background-size:200% 100%;animation:pt-shimmer 1.3s linear infinite}
@keyframes pt-shimmer{to{background-position:-200% 0}}
/* ---------------------------------------------------------------- /patterns page */
.pt-page{display:grid;gap:18px}
.pt-hero h1 em{font-style:normal;background:linear-gradient(90deg,var(--pt-accent),#2bb6c9);-webkit-background-clip:text;background-clip:text;color:transparent}
.pt-page>.pt-card{opacity:0;transform:translateY(12px);transition:opacity .6s var(--pt-ease),transform .7s var(--pt-ease)}
.pt-page>.pt-card.pt-in{opacity:1;transform:none}
.pt-lede{margin:0;font-size:14px;line-height:1.55;max-width:90ch}
.pt-spot{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.pt-spot-item{display:grid;grid-template-columns:64px minmax(0,1fr);grid-template-rows:auto auto;column-gap:12px;row-gap:6px;align-items:center;padding:12px;border-radius:14px;border:1px solid var(--pt-line);background:#fff;text-align:left;font:inherit;color:inherit;cursor:pointer;transition:transform .3s var(--pt-ease),box-shadow .3s}
.pt-spot-item .pt-glyph{grid-row:1/3}
.pt-spot-item b{display:block;font-size:13.5px}.pt-spot-item small{display:block;font-size:11.5px;color:var(--pt-muted);margin-top:2px}
.pt-spot-item:hover{transform:translateY(-2px);box-shadow:0 10px 24px -16px rgba(17,26,36,.45)}
.pt-board{display:grid;gap:12px}
.pt-controls{display:grid;gap:10px}
.pt-filters{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.pt-seg{display:inline-flex;flex-wrap:wrap;gap:4px;padding:4px;border-radius:12px;background:#eef0f3}
.pt-seg button{border:0;background:none;padding:9px 13px;border-radius:9px;font:600 13px/1 system-ui,sans-serif;color:var(--pt-muted);cursor:pointer;transition:background .2s,color .2s,box-shadow .2s}
.pt-seg button[aria-pressed="true"],.pt-seg button[aria-selected="true"]{background:#fff;color:var(--pt-ink);box-shadow:0 1px 3px rgba(0,0,0,.08)}
.pt-check{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:var(--pt-muted)}
.pt-check input{width:16px;height:16px;accent-color:var(--pt-accent)}
.pt-sort select,.pt-search input{padding:9px 12px;border-radius:10px;border:1px solid var(--pt-line);font:500 13px/1 system-ui,sans-serif;background:#fff}
.pt-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px}
.pt-pattern{display:grid;grid-template-columns:72px minmax(0,1fr);gap:12px;align-items:start;padding:14px;border-radius:16px;border:1px solid var(--pt-line);background:#fff;text-align:left;font:inherit;color:inherit;cursor:pointer;
  opacity:0;transform:translateY(10px);transition:opacity .45s var(--pt-ease),transform .55s var(--pt-ease),box-shadow .25s,border-color .25s;transition-delay:calc(var(--i) * 22ms)}
.pt-in .pt-pattern{opacity:1;transform:none}
.pt-pattern:hover{box-shadow:0 12px 28px -18px rgba(17,26,36,.5);border-color:#c9cfd6}
.pt-pattern[aria-pressed="true"]{border-color:var(--pt-accent);box-shadow:0 0 0 3px rgba(77,91,214,.15)}
.pt-pattern.is-quiet{background:#fbfcfd}.pt-pattern.is-quiet .pt-glyph{opacity:.55}
.pt-pattern-art{display:grid;place-items:center;height:56px;border-radius:12px;background:var(--pt-tile)}
.pt-pattern-body{display:grid;gap:6px;min-width:0}
.pt-pattern-top{display:flex;justify-content:space-between;gap:8px;align-items:start}
.pt-pattern-top b{font-size:14px;line-height:1.25}
.pt-count{font-size:12.5px;color:var(--pt-muted)}.pt-count b{font-size:15px;color:var(--pt-ink);font-variant-numeric:tabular-nums}
.pt-drawer{gap:16px;scroll-margin-top:80px}
.pt-drawer.pt-in{opacity:1;transform:none}
.pt-drawer-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px}
.pt-close{width:36px;height:36px;border-radius:50%;border:1px solid var(--pt-line);background:#fff;font-size:20px;line-height:1;cursor:pointer;color:var(--pt-muted)}
.pt-drawer-controls{display:flex;flex-wrap:wrap;gap:10px;justify-content:space-between}
.pt-rows{display:grid;border:1px solid var(--pt-line);border-radius:16px;overflow:hidden;transition:opacity .25s}
.pt-rows.is-busy{opacity:.5}
.pt-rows>.pt-skel{padding:12px}
.pt-row{display:grid;grid-template-columns:minmax(0,1.1fr) 220px minmax(0,1.3fr) 18px;gap:14px;align-items:center;padding:10px 14px;border-bottom:1px solid var(--pt-line);color:inherit;text-decoration:none;
  opacity:0;transform:translateY(8px);transition:opacity .45s var(--pt-ease),transform .5s var(--pt-ease),background .15s;transition-delay:calc(var(--i) * 25ms)}
.pt-in .pt-row{opacity:1;transform:none}
.pt-row:last-child{border-bottom:0}
.pt-row:hover{background:#f7f8fd}
.pt-row-co{display:grid;gap:3px;min-width:0}.pt-row-co b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pt-row-co small{font:500 11.5px/1 ui-monospace,Menlo,monospace;color:var(--pt-muted)}
.pt-row-mini{min-width:0;height:64px}
.pt-row-info{font-size:12.5px;color:var(--pt-muted);line-height:1.45}
.pt-row-go{color:var(--pt-muted)}
.pt-more{display:flex;justify-content:center}
@media (max-width:980px){.pt-stock{grid-template-columns:1fr}.pt-spot{grid-template-columns:1fr 1fr}.pt-hits{max-height:none}}
@media (max-width:720px){
  .pt-spot{grid-template-columns:1fr}
  .pt-row{grid-template-columns:minmax(0,1fr) 120px;grid-template-areas:"co mini" "info info"}
  .pt-row-co{grid-area:co}.pt-row-mini{grid-area:mini}.pt-row-info{grid-area:info}.pt-row-go{display:none}
  .pt-track-nums{grid-template-columns:1fr 1fr}
  .pt-explain-top{align-items:flex-start}.pt-glyph.is-big{width:84px;height:52px}
  .pt-seg{max-width:100%;overflow-x:auto;flex-wrap:nowrap}.pt-seg button{white-space:nowrap}
  .pt-drawer-controls,.pt-search,.pt-search input{width:100%}
}
@media (prefers-reduced-motion:reduce){
  .report-patterns .pt-card,.pt-page>.pt-card,.pt-pattern,.pt-row{opacity:1!important;transform:none!important;transition:none!important}
  .pt-glyph *,.pt-line,.pt-level,.pt-zone,.pt-box,.pt-mark,.pt-point,.pt-years i{animation:none!important;opacity:1!important;stroke-dashoffset:0!important;transform:none!important}
  .pt-skel span,.pt-pulse{animation:none!important}
}

.pt-liquid{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:var(--pt-muted);cursor:pointer}
.pt-liquid input{width:16px;height:16px;accent-color:var(--pt-accent)}
.pt-universe{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.pt-muted{font-size:13px;color:var(--pt-muted)}
