:root{
  --bg:#0b0f14;
  --panel:#101722;
  --panel2:#0f1620;
  --border:#1f2a37;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --accent:#22c55e;
  --danger:#ef4444;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 18px;
  --radius2: 14px;
  --font: "Kanit", "Noto Sans Thai", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--font);
  background: radial-gradient(1200px 600px at 20% 0%, rgba(34,197,94,.12), transparent 50%),
              radial-gradient(900px 500px at 80% 10%, rgba(59,130,246,.10), transparent 55%),
              var(--bg);
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  color:var(--text);
}

button,
input,
select,
textarea{
  font-family:var(--font);
}

a{ color:inherit; text-decoration:none; }
a:hover{ opacity:.9; }

.wrap{
  min-height:100vh;
  display:flex;
}

.sidebar{
  width:260px;
  position:fixed;
  inset:0 auto 0 0;
  z-index:10;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border-right:1px solid var(--border);
  padding:8px 14px 18px;
}

.brand{
  padding:14px 14px 12px 14px;
  border:1px solid rgba(59,130,246,.22);
  border-radius:var(--radius);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(34,197,94,.22), transparent 52%),
    linear-gradient(160deg, #172234 0%, #111927 55%, #0d1521 100%);
  box-shadow:
    0 22px 46px rgba(3,8,20,.34),
    inset 0 1px 0 rgba(255,255,255,.04);
}
.brand .title{ font-weight:700; letter-spacing:.2px; font-size:19px; }
.brand .sub{ color:var(--muted); font-size:13px; margin-top:3px; }

.nav{
  margin-top:14px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.nav a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:11px 12px;
  border-radius:14px;
  border:1px solid transparent;
  color:var(--muted);
}
.nav .nav-ico{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  color:inherit;
  opacity:.9;
}
.nav a.active{
  color:var(--text);
  background: rgba(34,197,94,.10);
  border-color: rgba(34,197,94,.25);
}
.nav a:hover{
  color:var(--text);
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.06);
}

.sidebar .footer{
  position:absolute;
  left:14px; right:14px; bottom:14px;
  padding:12px 12px;
  border:1px solid var(--border);
  border-radius:14px;
  color:var(--muted);
  font-size:12px;
  background: rgba(255,255,255,.02);
}

.main{
  margin-left:260px;
  width:calc(100% - 260px);
  padding:8px 22px 22px;
  position:relative;
  z-index:0;
}
.sidebar{
  transition: transform .2s ease;
}
.main{
  transition: margin-left .2s ease, width .2s ease;
}
body.sidebar-collapsed .sidebar{
  transform: translateX(-100%);
}
body.sidebar-collapsed .main{
  margin-left:0;
  width:100%;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 16px;
  border:1px solid rgba(34,197,94,.16);
  border-radius:var(--radius);
  background:
    linear-gradient(135deg, rgba(34,197,94,.12), rgba(59,130,246,.08)),
    linear-gradient(180deg, #16202f 0%, #0f1724 100%);
  box-shadow:
    0 24px 50px rgba(2,6,23,.28),
    inset 0 1px 0 rgba(255,255,255,.04);
  position:sticky;
  top:8px;
  z-index:20;
  backdrop-filter:none;
}
.topbar-left{
  display:flex;
  align-items:center;
  gap:10px;
}
.sidebar-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:10px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  background-color: rgba(255,255,255,.03);
  color:var(--muted);
  cursor:pointer;
  position:relative;
  z-index:21;
  pointer-events:auto;
  appearance:none;
  -webkit-appearance:none;
  touch-action: manipulation;
}
.sidebar-toggle svg{
  pointer-events:none;
}
.sidebar-toggle:hover{
  color:var(--text);
  background: rgba(255,255,255,.06);
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  color:var(--muted);
  border:1px solid rgba(255,255,255,.08);
  min-height:49px;
  padding:7px 16px;
  border-radius:999px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.badge-user{
  font-size:13px;
  color:#e5eefc;
  justify-content:flex-start;
}

.container{
  max-width:1100px;
  margin:18px auto 0 auto;
}

.h1{ font-size:22px; font-weight:700; margin:18px 0 4px; }
.p{ color:var(--muted); margin:0 0 18px; }

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}

.card{
  grid-column: span 4;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background: rgba(255,255,255,.02);
  box-shadow: var(--shadow);
  padding:16px;
}
.card.wide{ grid-column: span 8; }
.card.full{ grid-column: span 12; }

.card .label{ color:var(--muted); font-size:12px; }
.card .value{ font-size:18px; font-weight:700; margin-top:6px; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
  font-family:var(--font);
  font-size:14px;
  line-height:1.25;
}
.btn.small{
  padding:6px 10px;
  font-size:0.9em;
}
.btn.equal{
  width:110px;
  justify-content:center;
}
.btn:hover{ background: rgba(255,255,255,.06); }
.btn.primary{
  background: rgba(34,197,94,.14);
  border-color: rgba(34,197,94,.35);
}
.btn.primary:hover{ background: rgba(34,197,94,.18); }
.btn.danger{
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.30);
}

.form{
  max-width:420px;
  margin:0 auto;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background: rgba(255,255,255,.02);
  box-shadow: var(--shadow);
  padding:18px;
}
.input{
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
}
select,
select.input{
  background:#0b0f14 !important;
  color:#fff !important;
  color-scheme:dark;
}
select option,
select.input option{
  background:#0b0f14 !important;
  color:#fff !important;
}
.input.small{
  padding:6px 10px;
  font-size:0.9em;
}
.input:focus{
  border-color: rgba(34,197,94,.35);
  box-shadow: 0 0 0 3px rgba(34,197,94,.08);
}
.row{ margin-top:12px; }
.help{ color:var(--muted); font-size:12px; margin-top:10px; }

.alert{
  border:1px solid rgba(239,68,68,.30);
  background: rgba(239,68,68,.10);
  color:#fecaca;
  padding:10px 12px;
  border-radius:14px;
  margin-bottom:12px;
  font-size:13px;
}

.guide-content::after{
  content:"";
  display:block;
  clear:both;
}
.guide-content{
  font-size:1em;
  line-height:1.7;
}
.guide-content p{ margin:0 0 12px; }
.guide-content .text-tiny{ font-size:0.7em; }
.guide-content .text-small{ font-size:0.85em; }
.guide-content .text-big{ font-size:1.4em; }
.guide-content .text-huge{ font-size:1.8em; }
.guide-content .image{
  display:table;
  clear:both;
  text-align:center;
  margin:0 0 14px;
}
.guide-content .image > img,
.guide-content .image > a > img{
  display:block;
  margin:0 auto;
  max-width:100%;
  height:auto;
}
.guide-content .image.image-style-align-left{
  float:left;
  margin:0 14px 14px 0;
}
.guide-content .image.image-style-align-right{
  float:right;
  margin:0 0 14px 14px;
}
.guide-content .image.image-style-align-center{
  margin-left:auto;
  margin-right:auto;
}
.guide-content .image.image_resized{
  display:block;
  box-sizing:border-box;
  margin-left:auto;
  margin-right:auto;
}
.guide-content .image.image_resized > img{
  width:100%;
}
.guide-content .media{
  position:relative;
  padding-bottom:56.25%;
  height:0;
  overflow:hidden;
  margin:0 auto 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
  width:100%;
  max-width:720px;
}
.guide-content .media.media-size-sm,
.ck-content .media.media-size-sm{
  max-width:420px;
}
.guide-content .media.media-size-md,
.ck-content .media.media-size-md{
  max-width:560px;
}
.guide-content .media.media-size-full,
.ck-content .media.media-size-full{
  max-width:100%;
}
.guide-content .media iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
}

.wb-toolbar{ padding:18px; margin-bottom:12px; }
.wb-filter-form{
  display:grid;
  grid-template-columns: 220px 1fr auto auto auto;
  gap:12px;
  align-items:center;
}
.wb-list-card{ padding:18px; }
.wb-topic-list{
  display:grid;
  gap:16px;
}
.wb-topic-item{
  border:1px solid var(--border);
  border-radius:16px;
  background: rgba(255,255,255,.02);
  padding:16px;
}
.wb-topic-title-row{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.wb-topic-link{
  font-size:18px;
  font-weight:700;
  color:#fff;
}
.wb-topic-link:hover{
  color:#bbf7d0;
}
.wb-topic-meta{
  margin-top:10px;
  display:flex;
  gap:12px 16px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:13px;
}
.wb-topic-excerpt{
  margin:14px 0 10px;
  color:var(--muted);
  font-size:15px;
  line-height:1.75;
}
.wb-topic-stats{
  display:flex;
  gap:12px 16px;
  flex-wrap:wrap;
  font-size:13px;
  color:var(--muted);
}
.wb-meta-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.03);
}
.wb-meta-category{
  color:#86efac;
  border-color:rgba(34,197,94,.35);
  background:rgba(34,197,94,.14);
}
.wb-meta-author{
  color:#93c5fd;
  border-color:rgba(59,130,246,.35);
  background:rgba(59,130,246,.12);
}
.wb-meta-time{
  color:#fcd34d;
  border-color:rgba(245,158,11,.35);
  background:rgba(245,158,11,.10);
}
.wb-stat-reply{
  color:#c4b5fd;
  border-color:rgba(139,92,246,.35);
  background:rgba(139,92,246,.10);
}
.wb-stat-view{
  color:#f9a8d4;
  border-color:rgba(236,72,153,.35);
  background:rgba(236,72,153,.10);
}
.wb-stat-latest{
  color:#67e8f9;
  border-color:rgba(6,182,212,.35);
  background:rgba(6,182,212,.10);
}
.wb-stat-last-user{
  color:#a5f3fc;
  border-color:rgba(34,211,238,.35);
  background:rgba(34,211,238,.10);
}
.wb-badge-pin{
  border-color: rgba(251,191,36,.40);
  color:#fde68a;
}
.wb-badge-lock{
  border-color: rgba(239,68,68,.40);
  color:#fecaca;
}
.wb-pagination-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.wb-pagination-links{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
.wb-editor-card{ padding:18px; margin-top:12px; }
.wb-editor-form{
  display:grid;
  gap:12px;
}
.wb-textarea{
  min-height:180px;
  resize:vertical;
  line-height:1.8;
}
.wb-editor-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:4px;
}
.wb-topic-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.wb-topic-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.wb-topic-flags{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:12px;
}
.wb-topic-body{
  padding:20px;
  margin-bottom:12px;
}
.wb-body-text{
  white-space:normal;
  word-break:break-word;
  line-height:1.85;
  font-size:15px;
  color:#fff;
}
.wb-editor-card .label,
.wb-manage-panel .label,
.wb-reply-meta,
.wb-topic-header .h1,
.wb-reply-head .h1,
.wb-pagination-row .help,
.wb-reply-item .help{
  color:#fff;
}
.wb-toolbar .help,
.wb-manage-panel .help{
  color:#fff;
}
.wb-body-text p{
  margin:0 0 12px 0;
}
.wb-body-text ul,
.wb-body-text ol{
  margin:0 0 12px 22px;
  padding:0;
}
.wb-body-text blockquote{
  margin:0 0 12px 0;
  padding:10px 14px;
  border-left:3px solid rgba(34,197,94,.35);
  background:rgba(34,197,94,.07);
  border-radius:0 10px 10px 0;
}
.wb-body-text img{
  display:block;
  max-width:min(560px, 100%);
  height:auto;
  border-radius:12px;
  border:1px solid var(--border);
  margin:14px auto;
  cursor:zoom-in;
  box-shadow:0 10px 26px rgba(0,0,0,.35);
}
.wb-body-text .ql-align-center{text-align:center;}
.wb-body-text .ql-align-right{text-align:right;}
.wb-body-text .ql-align-justify{text-align:justify;}
.wb-manage-panel{
  display:grid;
  gap:10px;
  margin-bottom:12px;
}
.wb-inline-forms{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.wb-inline-forms form{
  margin:0;
}
.wb-reply-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:14px;
}
.wb-reply-list{
  display:grid;
  gap:14px;
}
.wb-reply-item{
  border:1px solid var(--border);
  border-radius:14px;
  background: rgba(255,255,255,.02);
  padding:14px;
}
.wb-reply-meta{
  display:flex;
  gap:10px 14px;
  align-items:center;
  flex-wrap:wrap;
  font-size:13px;
  color:var(--muted);
  margin-bottom:10px;
}
.wb-reply-user{
  color:#93c5fd;
}
.wb-reply-number{
  color:#f9a8d4;
}
.wb-reply-time{
  color:#fcd34d;
}
.wb-reply-edited{
  color:#86efac !important;
}
.wb-editor-shell{
  border:1px solid var(--border);
  border-radius:14px;
  overflow:visible;
  background:rgba(0,0,0,.18);
  position:relative;
}
.wb-source-hidden{
  display:none !important;
}
.ql-toolbar.ql-snow,
.ql-container.ql-snow{
  border:0 !important;
}
.ql-toolbar.ql-snow{
  border-bottom:1px solid var(--border) !important;
  background:rgba(255,255,255,.03);
  padding:10px 12px;
}
.ql-toolbar .ql-picker,
.ql-toolbar button,
.ql-editor,
.ql-tooltip{
  font-family:var(--font) !important;
}
.ql-toolbar button,
.ql-toolbar .ql-picker-label,
.ql-toolbar .ql-picker-item,
.ql-toolbar .ql-picker-options,
.ql-toolbar .ql-picker{
  color:#fff !important;
}
.ql-toolbar button svg{
  color:#fff;
}
.ql-snow .ql-stroke{
  stroke:#fff !important;
}
.ql-snow .ql-fill{
  fill:#fff !important;
}
.ql-snow .ql-picker{
  color:#fff !important;
}
.ql-snow .ql-picker-options{
  background:#0f1620 !important;
  border:1px solid var(--border) !important;
  color:#fff !important;
}
.wb-editor-shell .ql-tooltip{
  left:10px !important;
  right:10px !important;
  width:auto;
  max-width:calc(100% - 20px);
  transform:none !important;
  z-index:40;
  background:#0f1620 !important;
  border:1px solid var(--border) !important;
  box-shadow:0 12px 26px rgba(0,0,0,.38);
}
.wb-editor-shell .ql-tooltip::before{
  color:#fff;
  margin-right:8px;
}
.wb-editor-shell .ql-tooltip a.ql-action,
.wb-editor-shell .ql-tooltip a.ql-remove{
  color:#fff;
}
.wb-editor-shell .ql-tooltip input[type=text]{
  width:100%;
  min-width:0;
  color:#fff;
  background:#0b0f14;
  border-color:var(--border);
}
.ql-editor{
  min-height:220px;
  padding:14px;
  color:var(--text);
  font-size:15px;
  line-height:1.8;
}
.ql-snow .ql-editor.ql-blank::before{
  color:#cbd5e1 !important;
  opacity:1;
  font-style:normal;
}
.wb-editor-shell .wb-textarea{
  color:#fff;
}
.wb-editor-shell .wb-textarea::placeholder{
  color:#cbd5e1;
  opacity:1;
}
.ql-container{
  background:transparent;
}

.wb-image-modal{
  position:fixed;
  inset:0;
  z-index:1200;
  display:none;
}
.wb-image-modal.is-open{
  display:block;
}
.wb-image-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.78);
}
.wb-image-modal__panel{
  position:relative;
  z-index:1;
  margin:4vh auto;
  width:min(88vw, 980px);
  max-height:92vh;
  border:1px solid var(--border);
  border-radius:16px;
  background:#0f1620;
  box-shadow:0 28px 80px rgba(0,0,0,.55);
  padding:14px;
}
.wb-image-modal__close{
  position:absolute;
  top:8px;
  right:8px;
  z-index:2;
}
.wb-image-modal__img{
  display:block;
  margin:0 auto;
  max-width:100%;
  max-height:calc(92vh - 30px);
  border-radius:12px;
}
body.wb-modal-open{
  overflow:hidden;
}

@media (max-width: 900px){
  .wb-filter-form{
    grid-template-columns: 1fr;
  }
  .sidebar{ position:relative; width:100%; }
  .main{ margin-left:0; width:100%; }
  .grid{ grid-template-columns: 1fr; }
  .card, .card.wide, .card.full{ grid-column: span 12; }
  body.sidebar-collapsed .sidebar{ display:none; }
}
