/* ============================================================
   SETTINGS DRAWER — ngăn kéo phải, KHÔNG backdrop.
   Không có lớp phủ nào vì người dùng phải nhìn thấy dashboard đổi
   ngay sau lưng ngăn kéo khi kéo thanh trượt.
   ============================================================ */
.ydrawer{
  position: fixed; top: 0; right: 0; bottom: 0; width: 340px; max-width: 92vw;
  z-index: 880;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(14,10,26,.97), rgba(8,5,18,.98));
  border-left: 1px solid var(--acc, #8f6ff0);
  box-shadow: -18px 0 48px -22px rgba(0,0,0,.9), -1px 0 0 rgba(255,255,255,.05);
  transform: translateX(100%);
  transition: transform .22s cubic-bezier(.16,1,.3,1);
  color: var(--fg, #eae6f5);
}
.ydrawer.open{ transform: translateX(0); }
@media (prefers-reduced-motion: reduce){ .ydrawer{ transition: none; } }

.ydrawer-hd{
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.09);
}
.ydrawer-title{ font-size: 14px; font-weight: 700; letter-spacing: .02em; flex: 1; }
.ydrawer-x{
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12); background: transparent; color: inherit; cursor: pointer;
}
.ydrawer-x:hover{ background: rgba(255,255,255,.08); }
.ydrawer-x .ic{ width: 14px; height: 14px; }

.ydrawer-bd{ flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 18px; }
.ydrawer-ft{ flex: 0 0 auto; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.09); }

.ydgrp{ padding: 14px 0 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
.ydgrp:last-child{ border-bottom: 0; }
.ydgrp-hd{
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--acc, #8f6ff0);
}
.ydgrp-hd > span:first-child{ flex: 1; }
.ydnote{ font-size: 11.5px; line-height: 1.5; color: var(--muted, #9a8cbf); margin: 0 0 10px; }

.ydreset{
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.12); background: transparent; color: var(--muted,#9a8cbf); cursor: pointer;
}
.ydreset:hover{ color: inherit; background: rgba(255,255,255,.08); }
.ydreset .ic{ width: 12px; height: 12px; }

/* ─── Slider ─── */
.ydctrl{ margin-bottom: 12px; }
.ydctrl-hd{
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px;
  font-size: 12px; color: var(--fg, #eae6f5);
}
.ydctrl-hd > span:first-child{ flex: 1; }
.ydval{
  font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 700;
  color: var(--acc, #8f6ff0); min-width: 44px; text-align: right;
}
.ydctrl input[type=range]{
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 99px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--acc, #8f6ff0) 0%, rgba(255,255,255,.13) 100%);
}
.ydctrl input[type=range]::-webkit-slider-thumb{
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%; cursor: grab;
  background: #fff; border: 2px solid var(--acc, #8f6ff0);
  box-shadow: 0 0 0 3px rgba(143,111,240,.18), 0 1px 4px rgba(0,0,0,.5);
}
.ydctrl input[type=range]::-webkit-slider-thumb:active{ cursor: grabbing; }
.ydctrl input[type=range]::-moz-range-thumb{
  width: 15px; height: 15px; border-radius: 50%; cursor: grab;
  background: #fff; border: 2px solid var(--acc, #8f6ff0);
}
.ydctrl input[type=range]:focus-visible{ box-shadow: 0 0 0 2px var(--acc, #8f6ff0); }

.ydtoggle{
  display: flex; align-items: center; gap: 9px; margin-bottom: 10px;
  font-size: 12px; cursor: pointer;
}
.ydtoggle input{ width: 15px; height: 15px; accent-color: var(--acc, #8f6ff0); cursor: pointer; }

/* ─── Preset ─── */
.ydpreset-cur{ font-size: 10px; font-weight: 600; color: var(--muted, #9a8cbf); text-transform: none; letter-spacing: 0; }
.ydpresets{ display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ydpreset{
  display: flex; align-items: center; gap: 7px; padding: 8px 9px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.03);
  color: inherit; font-size: 11.5px; cursor: pointer; text-align: left;
}
.ydpreset:hover{ background: rgba(255,255,255,.07); }
.ydpreset.on{ border-color: var(--acc, #8f6ff0); background: rgba(143,111,240,.14); }
.ydpreset-sw{
  width: 16px; height: 16px; border-radius: 5px; flex-shrink: 0;
  background: rgba(180,120,255, calc(var(--pa, .3) + .08));
  border: 1px solid rgba(180,120,255, .8);
  box-shadow: 0 0 calc(var(--pg, 1) * 7px) rgba(180,120,255,.75);
}

/* ─── Nút ─── */
.ydrow2{ display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.ydbtn{
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 12px; border-radius: 9px; font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); color: inherit;
}
.ydbtn:hover{ background: rgba(255,255,255,.09); }
.ydbtn .ic{ width: 13px; height: 13px; }
.ydbtn-primary{ border-color: var(--acc, #8f6ff0); background: rgba(143,111,240,.18); }
.ydbtn-danger{ width: 100%; border-color: rgba(255,120,120,.36); color: #ffb4b4; }
.ydbtn-danger:hover{ background: rgba(255,90,90,.14); }

/* Tông màu — dùng lại .tone-opt của dashboard.css nhưng đảm bảo có mặt
   kể cả khi ngăn kéo mở ở cửa không phải HR (không nạp dashboard.css). */
.ydrawer .lang-opts, .ydrawer .tone-opts{ display: flex; flex-wrap: wrap; gap: 7px; }
.ydrawer .lang-opt, .ydrawer .tone-opt{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: 8px; font-size: 12px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.03); color: inherit;
}
.ydrawer .lang-opt:hover, .ydrawer .tone-opt:hover{ background: rgba(255,255,255,.08); }
.ydrawer .lang-opt.on, .ydrawer .tone-opt.on{ border-color: var(--acc, #8f6ff0); background: rgba(143,111,240,.16); }
.ydrawer .tone-sw{ width: 12px; height: 12px; border-radius: 50%; background: currentColor; opacity: .85; }
.ydrawer .tone-opt[data-tone="purple"] .tone-sw{ background: #b478ff; }
.ydrawer .tone-opt[data-tone="green"] .tone-sw{ background: #38ff9c; }
