/* r315: chart layout picker - all layouts at once, one row per number of charts (theme variables only). */
.pop:has(.lay-rows) { width: 452px; max-width: calc(100vw - 16px); }
.pop .lay-head { display: flex; align-items: baseline; gap: 10px; }
.pop .lay-cur { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--t3); text-transform: none; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62%; }
.lay-rows { display: flex; flex-direction: column; gap: 1px; padding: 2px 6px 6px; max-height: min(56vh, 520px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.lay-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 4px; padding: 1px 0; border-radius: 8px; }
.lay-row:hover { background: var(--fill); }
.lay-row > b { font-size: 11.5px; font-weight: 600; color: var(--t3); text-align: center; font-variant-numeric: tabular-nums; }
.lay-icons { display: flex; flex-wrap: wrap; gap: 2px; }
.lay-rows .lay-b { width: 34px; height: 30px; min-height: 0; padding: 0; border: 1px solid transparent; border-radius: 7px; color: var(--t2); background: transparent; display: grid; place-items: center; transition: background .12s var(--ease), color .12s var(--ease); }
.lay-rows .lay-b svg { width: 26px; height: 24px; }
.lay-rows .lay-b svg rect { fill: currentColor; fill-opacity: .12; }
.lay-rows .lay-b:hover { background: var(--fill-2); color: var(--t1); }
.lay-rows .lay-b.on { background: var(--fill-2); color: var(--t1); border-color: var(--t3); }
.lay-rows .lay-b.on svg rect { fill-opacity: .28; }
.lay-rows .lay-b:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 1px; }
@media (max-width: 767px) {
  .lay-rows { max-height: 48vh; }
  .lay-rows .lay-b { width: 40px; height: 36px; }
  .lay-rows .lay-b svg { width: 30px; height: 27px; }
}

/* small panels in 8-16 chart layouts: keep the symbol readable, drop extras that do not fit */
@media (max-width: 300px) { body.embed .lg-ohlc { display: none; } body.embed .legend { max-width: calc(100% - 16px); } }
@media (max-height: 170px) { body.embed .rail { display: none; } }
