/* The signal screen (한국 주식 시그널): the candidates the R2 selection passes for the next trading day, and why the rest are out.
   It stands on the site's own frame and tokens (hub.css): the strip, the header, cards, tags, rows. Everything here is
   prefixed sg- or scoped under .sg, so the two sheets can ship together.
   At 1440 the column is the main page's: 1216 = 816 + 16 + 384. The screen is read once a day, mostly on a phone, before
   the market opens: the selected stocks first, the evidence of each beside it, then what kept the others out. */
.sg-brand{flex:0 0 auto;display:flex;margin-left:8px}
.sg-top{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:14px 24px;padding:12px 0 0}
.sg-id{flex:1 1 380px;min-width:0;display:flex;flex-direction:column;gap:6px}
.sg-ht{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
.sg-h{font-size:24px;line-height:32px;font-weight:650;letter-spacing:-.02em}
/* the two tags keep together: on a narrow phone both go under the name, never one of them alone */
.sg-tags{display:inline-flex;gap:6px}
/* the finding of the chosen day, in words: its two counts, then the condition that kept the most candidates out */
.sg-lead{display:flex;flex-wrap:wrap;gap:0 14px;font-size:15px;line-height:22px;color:var(--tx-2);font-variant-numeric:tabular-nums}
.sg-lead-a{color:var(--tx-1);font-weight:500}
/* the entry day: five cells, the newest first. The chosen one is the banner's chosen candle: the accent thinned onto the
   card, a full-strength edge, the accent's text step. Each cell says the day and what it selected, so the choice never
   rests on colour alone */
.sg-days{flex:0 1 auto;display:flex;align-items:center;gap:10px;min-width:0}
.sg-days-l{flex:0 0 auto;font-size:13px;color:var(--tx-3);white-space:nowrap}
.sg-days-r{flex:0 1 auto;display:flex;gap:4px;min-width:0}
.sgd{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:84px;min-height:48px;padding:5px 10px;border:1px solid var(--br);border-radius:var(--r1);background:var(--s1);line-height:1.25;text-align:center;white-space:nowrap}
.sgd-d{font-family:'IBM Plex Mono','Pretendard Variable',ui-monospace,monospace;font-size:13px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--tx-1)}
.sgd-w{margin-left:5px;font-family:'Pretendard Variable',Pretendard,system-ui,sans-serif;font-weight:500;color:var(--tx-2)}
.sgd-n{font-size:12px;color:var(--tx-3)}
.sgd-has .sgd-n{font-weight:600;color:var(--tx-1)}
.sgd[aria-pressed="true"]{border-color:var(--amber);background:color-mix(in oklab,var(--amber) 10%,var(--s1))}
.sgd[aria-pressed="true"] .sgd-d,.sgd[aria-pressed="true"] .sgd-w,.sgd[aria-pressed="true"] .sgd-n{color:var(--amber-tx)}
/* what the list is and is not, said once and kept on the first screen: a quiet notice, never a ground */
.sg-note{display:flex;align-items:flex-start;gap:8px;padding:9px 14px;border:1px solid var(--br);border-radius:var(--r2);font-size:13px;line-height:20px;color:var(--tx-2)}
.sg-note .ic{margin-top:2px;color:var(--tx-3)}

/* two columns that end on one line: the lists down the main column, the conditions beside them. The rules card takes up
   what the side is short by (its five rows share the room); should the lists be filtered shorter, the side simply ends lower */
.sg-cols{display:grid;grid-template-columns:minmax(0,1fr) var(--side);gap:var(--gap);align-items:stretch}
.sg-main,.sg-side{display:flex;flex-direction:column;gap:var(--gap);min-width:0}
/* The two columns end on one line. How many excluded rows show follows from how tall the selected list is (the screen's
   logic picks four to eight), which brings the columns within a row of each other; what is left, the rules card takes up
   when the side is the short one (its five rows share the room), and the excluded rows when the main column is. A list
   that is filtered or short keeps its rows as they are, and against an unusually long selected list (.is-long) the side
   simply ends first: no card is ever stretched into an empty band */
.sg-side > .sg-rules{flex:1 0 auto}
.is-long .sg-side > .sg-rules,.is-long .sg-main > .sg-gate{flex:0 0 auto}
.sg-main > .sg-outs{flex:1 0 auto}
.sg-outs .sgl-o{flex:1 0 auto}
.sg-outs .sgl-o .sgr{flex:1 0 auto}
.sg-main > .sg-outs.is-cut,.is-cut .sgl-o,.is-cut .sgl-o .sgr{flex:0 0 auto}
.sg-basis{margin-left:auto;white-space:nowrap}
.sg-cnt{font-size:15px;font-weight:600;color:var(--tx-2)}

/* a list of candidates: a head row of column names, then one row a stock. The identity takes the room that is left, figures
   stand right-aligned in fixed columns and every row ends on the card's padding line. Each cell carries its own label (.sg-k),
   read by a screen reader always and shown where the head row has no room to stand (a narrow card) */
.sgh,.sgr{display:grid;align-items:center;column-gap:12px;padding-left:18px;padding-right:18px}
.sgl-p .sgh,.sgl-p .sgr{grid-template-columns:minmax(0,1fr) 100px 92px 92px 164px 36px}
.sgl-o .sgh,.sgl-o .sgr{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) 100px 92px 92px}
/* the preview, for a reader the screen is not open to: who was selected and the state of the leading CVD group, nothing else */
.sgl-v .sgh,.sgl-v .sgr{grid-template-columns:minmax(0,1fr) 164px}
.sgl-v .sgr{min-height:56px}
.sg-cut{padding:10px 18px 12px;border-top:1px solid var(--br)}
/* the state column stands a step off the figures: a left-aligned head beside a right-aligned one would read as one phrase */
.sgl-p .c-cvd,.sgl-l .c-cvd,.sgl-v .c-cvd{padding-left:14px}
.sgh{min-height:30px;font-size:12px;color:var(--tx-3)}
.sgr{min-height:64px;padding-top:9px;padding-bottom:9px;border-top:1px solid var(--br)}
.c-tv,.c-f,.c-i{text-align:right;white-space:nowrap}
.sg-k{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.sg-v{font-size:14px;line-height:20px;color:var(--tx-1)}
.sg-u{margin-left:1px;font-family:'Pretendard Variable',Pretendard,system-ui,sans-serif;font-size:12px;letter-spacing:0;color:var(--tx-3)}
/* a value that did not come: a short grey mark, never a zero */
.sg-none{display:inline-block;width:8px;height:2px;border-radius:1px;background:var(--tx-3);vertical-align:middle}
.c-go{justify-self:end;color:var(--tx-2)}
.c-go .ic{width:18px;height:18px}
/* why a candidate is out: plain chips, one a reason, three at the most and the count of the rest */
.c-why{display:flex;flex-wrap:wrap;gap:4px;min-width:0}
.why{flex:0 0 auto;display:inline-flex;align-items:center;height:22px;padding:0 7px;border-radius:var(--r1);background:var(--s2);font-size:12px;font-weight:600;color:var(--tx-2);white-space:nowrap}
.why-m{background:none;padding-inline:2px;font-weight:500;color:var(--tx-3)}

/* a day with nothing selected says so, says why, and fills the room with the last day that had any */
.sg-zero{display:flex;flex-direction:column;gap:4px;padding:6px 18px 16px}
.sg-zero-h{font-size:20px;line-height:28px;font-weight:650;letter-spacing:-.015em}
.sg-last{display:flex;flex-direction:column;border-top:1px solid var(--br)}
.sg-last-h{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:4px 18px}
.sg-last-t{font-size:13px;font-weight:600;color:var(--tx-2)}
.sgl-l .sgh,.sgl-l .sgr{grid-template-columns:minmax(0,1fr) 100px 164px}
.sgl-l .sgr{min-height:56px}

/* the excluded list's filter: one row of chips, each a condition and how many it kept out. A chip looks 32px and is a 32px
   target on a pointer; under a finger it takes 44 */
.sg-why{display:flex;flex-wrap:wrap;gap:6px;padding:0 18px 10px}
.chip{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:0 10px;border:1px solid var(--br);border-radius:var(--r1);background:var(--s1);font-size:13px;font-weight:500;color:var(--tx-2);white-space:nowrap}
.chip-n{font-size:12px;color:var(--tx-3)}
.chip[aria-pressed="true"]{border-color:var(--tx-1);color:var(--tx-1);font-weight:650}
.chip[aria-pressed="true"] .chip-n{color:var(--tx-2)}
.sg-outs .card-f{margin-top:0}

/* how many candidates passed each condition: a name, a figure and a thin bar a row, bars on one line. Grey on grey, the
   lighter step as the track; the last row, all five at once, is the selection itself and takes the accent */
/* the rows share whatever height the card is given (beside the taller rules card in a two-up row), so its foot stays its foot */
.sgm{flex:1 0 auto;display:flex;flex-direction:column;padding:0 18px}
.sgm-r{flex:1 0 auto;display:flex;flex-direction:column;justify-content:center;gap:7px;padding:10px 0 12px}
.sgm-r + .sgm-r{border-top:1px solid var(--br)}
.sgm-t{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:14px;line-height:20px}
.sgm-n{min-width:0}
.sgm-v{flex:0 0 auto;font-size:14px;white-space:nowrap}
.sgm-p{font-weight:600}
.sgm-o{margin-left:5px;color:var(--tx-3)}
.sgm-bar{display:block;height:6px;border-radius:3px;background:var(--s3);overflow:hidden}
.sgm-bar i{display:block;height:100%;min-width:0;border-radius:0 3px 3px 0;background:var(--tx-2)}
.sgm-all{flex-direction:column;align-items:stretch;gap:7px;padding-top:12px;padding-bottom:14px}
.sgm-all .sgm-n{font-weight:650}
.sgm-all .sgm-bar{background:var(--amber-dim)}
.sgm-all .sgm-bar i{background:var(--amber)}

/* the five conditions in words. The rows share whatever height the column gives the card */
.sg-rl{flex:1 0 auto;display:flex;flex-direction:column;padding:0 18px}
.sg-rule{flex:1 0 auto;display:flex;flex-direction:column;justify-content:center;gap:2px;padding:10px 0}
.sg-rule + .sg-rule{border-top:1px solid var(--br)}
.sg-rule dt{font-size:14px;line-height:20px;font-weight:600}
.sg-rule dd{font-size:13px;line-height:19px;color:var(--tx-2);text-wrap:pretty}
.sg-rules .card-f{justify-content:flex-start}

/* a state of the selected list that is not a day's result: the prior day's data still coming in */
.sg-wait{display:flex;flex-direction:column;gap:4px;padding:6px 18px 18px}
/* the gate, for a reader the screen is not open to: what the whole of it holds, four plain rows each behind a lock, and the
   one way on. It stands where the excluded list would and takes up what the main column is short by, as that list does */
.sg-main > .sg-gate{flex:1 0 auto}
.sg-gl{flex:1 0 auto;display:flex;flex-direction:column}
.sg-g{flex:1 0 auto;display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 18px;border-top:1px solid var(--br)}
.sg-g > .ic{flex:0 0 auto;width:16px;height:16px;stroke-width:1.8;color:var(--tx-3)}
.sg-g-t{display:flex;flex-direction:column;gap:1px;min-width:0}
.sg-g-n{font-size:15px;line-height:22px;font-weight:600}
/* beside a selected list of three rows or more the four lines stand two by two (the screen's logic says when) */
.sg-gate-2 .sg-gl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:1fr}
.sg-gate-2 .sg-g:nth-child(even){border-left:1px solid var(--br)}
.sg-gate-f{padding-top:10px;padding-bottom:10px}
.sg-gate-b{flex:0 0 auto;display:flex;flex-wrap:wrap;gap:8px;margin-left:auto}

@media (hover:hover) and (pointer:fine){
.sgd:hover,.chip:hover{border-color:var(--br-hi)}
.sgd[aria-pressed="true"]:hover{border-color:var(--amber)}
.chip[aria-pressed="true"]:hover{border-color:var(--tx-1)}
.c-go:hover{background:var(--s2);color:var(--tx-1)}
}
.sgd:active,.chip:active{transform:scale(.97)}
@media (prefers-reduced-motion:no-preference){
.sgd,.chip{transition:transform 160ms var(--ease),background-color 150ms ease,border-color 150ms ease,color 150ms ease}
}

/* a card too narrow for the columns (a phone, or the main column of a narrow window): the head row goes, every cell shows
   its own label, and a row is the stock, then its three figures as three equal columns, then the CVD group */
@container (max-width:700px){
.sgh{display:none}
.sgr{align-items:start;row-gap:8px;padding-top:12px;padding-bottom:12px}
/* three columns that share the row, and none narrower than its own figure: on the narrowest phone a long amount takes the
   room it needs from its neighbours instead of running into them */
.sgl-p .sgr{grid-template-columns:repeat(3,minmax(min-content,1fr));grid-template-areas:"n n go" "tv f i" "cvd cvd cvd"}
.sgl-v .sgr{grid-template-columns:minmax(0,1fr);grid-template-areas:"n" "cvd";min-height:0}
.sg-gate-2 .sg-gl{grid-template-columns:minmax(0,1fr);grid-auto-rows:auto}
.sg-gate-2 .sg-g:nth-child(even){border-left:0}
.sgl-o .sgr{grid-template-columns:repeat(3,minmax(min-content,1fr));grid-template-areas:"n n n" "why why why" "tv f i"}
.sgl-l .sgr{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"n tv" "cvd cvd";min-height:0}
.sgr > .c-n{grid-area:n}
.sgr > .c-go{grid-area:go;margin:-6px -8px -6px 0}
.sgr > .c-why{grid-area:why;align-items:center}
.sgr > .c-tv{grid-area:tv}
.sgr > .c-f{grid-area:f}
.sgr > .c-i{grid-area:i}
.sgr > .c-cvd{grid-area:cvd;display:flex;flex-wrap:wrap;align-items:center;gap:2px 8px;padding-left:0}
/* no pointer to hover a cut name with: here a long name takes a second line instead */
.sgr .sg-name{overflow:visible;text-overflow:clip;white-space:normal}
.sgr > .c-tv,.sgr > .c-f,.sgr > .c-i{display:flex;flex-direction:column;text-align:left}
.sgl-l .sgr > .c-tv{align-items:flex-end;text-align:right}
.sgr .sg-k{position:static;width:auto;height:auto;margin:0;overflow:visible;clip-path:none;font-size:12px;line-height:17px;color:var(--tx-3)}
.sgr > .c-why .sg-k{margin-right:4px}
.sgr > .c-cvd .sg-k{flex:0 0 auto}
.sgr .sg-grp{padding-left:0}
.sgl-l .sgr > .c-cvd .sg-k{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%)}
}
/* 1223 and under the window cannot hold the lists beside the conditions (a list wants 760px for its figures and a name
   of some length, and 760 + 16 + 384 + 64 is 1224): one column. The conditions and the rules then stand side by side
   under the lists while there is room for two, and the way to the CVD chart runs under both */
@media (max-width:1223px){
.sg-cols{grid-template-columns:minmax(0,1fr)}
.sg-side > .sg-rules,.sg-main > .sg-outs,.sg-main > .sg-gate{flex:0 0 auto}
.sg-side{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}
.sg-side > :last-child{grid-column:1 / -1}
}
@media (max-width:720px){
.sg-side{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:900px){
.sg-brand{margin-left:0}
.sg-top{padding-top:8px}
.sg-days{flex:1 1 100%}
/* the days slide sideways inside their own row, the page never does; the newest stands first, in view, and the row fades
   out at its end the way the banner's ranking does */
.sg-days-r{flex:1 1 0;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;margin:-3px;padding:3px 28px 3px 3px;-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent)}
.sg-days-r::-webkit-scrollbar{display:none}
.app .sgd:focus-visible,.app .chip:focus-visible{outline-offset:-2px}
/* the filter is one row too, and slides the same way */
.sg-why{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding-right:28px;-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent)}
.sg-why::-webkit-scrollbar{display:none}
}
@media (pointer:coarse){
.chip{min-height:44px}
.c-go{width:44px;height:44px}
}
@media (max-width:720px){
.sg-h{font-size:22px;line-height:30px}
.sg-note{padding:9px 12px}
.sgh,.sgr,.sgm,.sg-rl,.sg-zero,.sg-last-h,.sg-wait,.sg-g,.sg-cut{padding-left:16px;padding-right:16px}
.sg-why{padding-left:16px}
.chip{min-height:44px}
.c-go{width:44px;height:44px}
.sg-basis{margin-left:0;flex:1 1 100%}
}
/* the note under the selected list: what the last column is and where its colours come from */
.app .sg-key{display:block;min-height:0;padding-top:10px;padding-bottom:12px}
