/* ============ প্যানেল ও ড্রয়ার স্টাইল (panels.css) ============ */

/* নিচের শিট (BottomSheet container) */
.sheet {
  flex: none;
  max-height: 42dvh;
  overflow-y: auto;
  background: var(--sh);
  border-top: 1px solid var(--ln);
  padding: 6px 14px 12px;
  border-radius: 18px 18px 0 0;
  margin-top: -1px;
  position: relative;
}

.sheet::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--ln);
  margin: 0 auto 4px;
}

/* টেমপ্লেট প্যানেল */
.tpls {
  margin-top: 4px;
}

.tpls .tpl {
  position: relative;
  padding: 4px 4px 3px;
  gap: 3px;
  width: 70px;
  border-radius: 12px;
}

.th {
  width: 60px;
  height: 74px;
  border-radius: 7px;
  display: block;
}

.tpl span {
  font-size: 11.5px;
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpl .x {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ac);
  color: #fff;
  font-style: normal;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

.tpl.on {
  box-shadow: 0 0 0 2px var(--ac);
  border-color: var(--ac);
  background: var(--soft);
  color: var(--tx);
}

/* PIP ও ওভারলে লিস্ট */
#pipList, #ovList {
  flex: 1;
  min-width: 0;
  padding: 0;
}

#pipList > button {
  padding: 2px;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  overflow: hidden;
}

#pipList img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#pipList > button.on {
  box-shadow: 0 0 0 2px var(--ac);
  border-color: var(--ac);
}

/* সেগমেন্টেড কন্ট্রোল */
.seg {
  display: flex;
  gap: 5px;
}

.seg button {
  flex: 1;
  padding: 8px 2px;
}

.seg button.on {
  background: var(--tx);
  color: var(--bar);
  border-color: var(--tx);
}

/* আউটপুট ইনফো */
.out {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--soft);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
}

.out .warn {
  color: #e9a23b;
}

/* লোগো প্রিভিউ বক্স */
.logo-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.logo-prev {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 10px;
  border: 1px dashed var(--ln);
  background: conic-gradient(#0000 25%, rgba(128, 128, 128, .15) 0 50%, #0000 0 75%, rgba(128, 128, 128, .15) 0) 0 0/12px 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 10.5px;
  color: var(--mu);
  text-align: center;
}

.logo-prev img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-act {
  flex: 1;
  min-width: 0;
}

.logo-act label.line {
  margin-top: 6px;
}

/* সংরক্ষিত পোস্টারের তালিকা */
.item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--ln);
}

.item:first-child {
  border-top: 0;
}

.item img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 7px;
  background: var(--soft);
  flex: none;
}

.item div {
  min-width: 0;
  flex: 1;
}

.item b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  font-size: 13.5px;
}

.item small {
  color: var(--mu);
  font-size: 12px;
}

.item button {
  padding: 5px 10px;
  font-size: 12.5px;
}

/* উপাদানের তালিকা (Drawer / Layers Sidebar) */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: 29;
}

.scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 88vw);
  background: var(--sh);
  border-left: 1px solid var(--ln);
  z-index: 30;
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  transition: transform .25s;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  visibility: hidden;
}

.drawer.open {
  transform: none;
  visibility: visible;
}

.dh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 6px 0 16px;
  border-bottom: 1px solid var(--ln);
  flex: none;
}

.dh b {
  font: 700 15px 'Noto Serif Bengali', serif;
}

.dn {
  padding: 8px 16px 2px;
}

.ll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 14px;
}

.lr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
}

.lr + .lr {
  margin-top: 3px;
}

.lr.on {
  background: var(--soft);
  border-color: var(--ac);
}

.lr.off .lt, .lr.off .ln {
  opacity: .4;
}

.lt {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 9px;
  background: var(--soft);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--mu);
}

.lr.on .lt {
  background: var(--sh);
}

.lt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ln {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.ln b {
  display: block;
  font-weight: 500;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ln small {
  color: var(--mu);
  font-size: 11.5px;
}

.lr button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 9px;
  color: var(--mu);
  flex: none;
}

.lr button:active {
  background: var(--soft);
}

.lr button.act {
  color: #f5b301;
}

.lr button[data-a=del]:active {
  color: #ff6b6b;
}

/* অবজেক্ট ও স্টিকার প্যানেল */
.osub {
  margin-top: 2px;
}

.alg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.alg button, .nudge button {
  padding: 8px 4px;
}

.nudge {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}

#objSeg {
  margin: 6px 0 2px;
}

#objSeg button {
  font-size: 12.5px;
  padding: 7px 2px;
}

.scbar {
  margin-top: 2px;
}

.scbar .inline {
  gap: 6px;
}

.scbar .chips {
  flex: 1;
  min-width: 0;
  padding: 0;
}

.scbar .chips .dot {
  width: 26px;
  height: 26px;
}

#stkList > button {
  min-width: 62px;
}
