/* WWDC BOT panel replica — colours come from CSS vars set by panel.js (Theme.java palettes). */
@font-face { font-family: "NotoThai"; src: url("assets/fonts/NotoSansThai-Regular.ttf"); font-weight: 400; }
@font-face { font-family: "NotoThai"; src: url("assets/fonts/NotoSansThai-Medium.ttf"); font-weight: 500; }
@font-face { font-family: "NotoThai"; src: url("assets/fonts/NotoSansThai-Bold.ttf"); font-weight: 700; }

.wd-stage {
  --bg: #040806; --bg-hi: #2a2e2c; --bg-lo: #030605; --surf: #0e1611; --surf-hi: #0e1611; --surf-lo: #0b110d;
  --line: #1d2a22; --text: #fff; --sub: #9db0a4; --muted: #5a6b60; --accent: #0bda51; --accent-ink: #03140a;
  --good: #0bda51; --danger: #dc143c; --value: #6cf59a; --gold: #ffc72c;
  position: relative; width: 100%; aspect-ratio: 16 / 10; min-height: 420px; overflow: hidden;
  font-family: "NotoThai", "Noto Sans Thai", system-ui, sans-serif; color: var(--text);
  background: #0a0d10; border-radius: 14px; user-select: none; -webkit-user-select: none;
}
.wd-stage * { box-sizing: border-box; }
.wd-game {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 70% 40%, rgba(255,190,90,.18), transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(120,70,40,.35), transparent 60%),
    linear-gradient(160deg, #3b2a22 0%, #22160f 45%, #120c09 100%);
  filter: saturate(1.1);
}
.wd-game::after { content: "หน้าจอเกม (ตัวอย่าง)"; position: absolute; right: 18px; bottom: 12px; font-size: 12px; color: rgba(255,255,255,.25); }

/* top toolbar of the demo itself (not part of the bot) */
.wd-toolbar { position: absolute; left: 0; right: 0; top: 0; height: 38px; z-index: 6; display: flex; align-items: center; gap: 10px;
  padding: 0 12px; background: linear-gradient(#000a, #0000); font-size: 12.5px; }
.wd-tb-title { font-weight: 700; color: #fff; margin-right: auto; opacity: .85; }
.wd-tb-guide { display: flex; align-items: center; gap: 6px; color: #dfe; cursor: pointer; }
.wd-tb-btn { font: inherit; font-weight: 700; color: #fff; background: #ffffff1c; border: 1px solid #ffffff30; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.wd-tb-btn:hover { background: #ffffff30; }

/* panel is laid out at a fixed 1180x700 design size and scaled to fit the stage */
.wd-scaler { position: absolute; inset: 40px 0 0 0; display: flex; align-items: center; justify-content: center; z-index: 2; }
.wd-panel { position: relative; width: 1180px; height: 700px; transform-origin: center center; flex: none; }
.wd-panel.wd-hidden { display: none; }

/* cut-corner primitives: diagonal (TL + BR) cut like the app's Cut(DIAG) */
.cut { --c: 8px; clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c)); }
.shell {
  position: absolute; inset: 0; --c: 18px;
  clip-path: polygon(var(--c) 0, calc(50% - 70px) 0, calc(50% - 62px) 7px, calc(50% + 62px) 7px, calc(50% + 70px) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 94%, var(--accent)) 0%, var(--bg-lo) 100%);
  box-shadow: inset 0 1px 0 #ffffff55, inset 0 -2px 0 #000a;
}
.shell::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #ffffff10, #0000 18%); pointer-events: none; }
.wd-inner { position: absolute; inset: 0; padding: 14px 16px 14px; display: flex; flex-direction: column; }

/* plates */
.plate { background: linear-gradient(180deg, color-mix(in srgb, var(--surf-hi) 94%, var(--text)), var(--surf-lo));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 17%, transparent), inset 0 -1px 0 #000a, inset 0 0 0 3px color-mix(in srgb, var(--text) 6%, transparent); }
.well { background: linear-gradient(180deg, color-mix(in srgb, var(--bg-lo) 70%, #000), color-mix(in srgb, var(--bg-lo) 94%, var(--value)));
  box-shadow: inset 0 1px 0 #0009, inset 0 -1px 0 color-mix(in srgb, var(--value) 25%, transparent); }
.key { background: linear-gradient(180deg, color-mix(in srgb, var(--k) 86%, #fff), color-mix(in srgb, var(--k) 75%, #000));
  box-shadow: inset 0 1px 0 #fff9, inset 0 -1px 0 #0008, inset 0 6px 8px -6px #ffffff50; color: var(--ki); }
.tint { background: linear-gradient(180deg, color-mix(in srgb, var(--surf-hi) 80%, var(--k)), color-mix(in srgb, var(--surf-lo) 93%, var(--k)));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--k) 55%, transparent), inset 0 -1px 0 #0009, inset 0 0 0 3px color-mix(in srgb, var(--k) 19%, transparent); }

/* top bar */
.wd-top { height: 44px; display: flex; align-items: center; gap: 10px; flex: none; }
.wd-logo { width: 40px; height: 40px; --c: 9px; display: grid; place-items: center; background: #5c24d2;
  box-shadow: inset 0 1px 0 #ffffff66, inset 0 -1px 0 #0009; }
.wd-logo img { width: 37px; height: 37px; }
.wd-brand { font-weight: 700; font-size: 16px; letter-spacing: .08em; }
.wd-pill { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 6px; background: color-mix(in srgb, var(--pc, var(--accent)) 16%, #000); color: var(--pc, var(--accent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc, var(--accent)) 30%, transparent); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.wd-spacer { flex: 1; }
.wd-orb { width: 150px; height: 42px; --c: 9px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: transform .08s; }
.wd-orb:active, .wd-ib:active, .wd-press:active { transform: scale(.96); }
.wd-orb .o-l { display: flex; flex-direction: column; align-items: center; width: 90px; line-height: 1.12; }
.wd-orb .o-t { font-size: 14px; font-weight: 700; }
.wd-orb .o-s { font-size: 9.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
.wd-ib { width: 40px; height: 40px; --c: 9px; display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ibf) 94%, var(--text)), color-mix(in srgb, var(--ibf) 70%, #000));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ibc) 33%, transparent), inset 0 -1px 0 #0009; }

/* readout strip */
.wd-strip { display: flex; gap: 5px; margin-top: 8px; flex: none; }
.wd-cell { --c: 7px; padding: 5px 9px 6px; min-width: 0; cursor: pointer; }
.wd-cell .k { font-size: 10px; color: var(--muted); white-space: nowrap; }
.wd-cell .v { font-size: 13px; font-weight: 700; color: var(--value); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-cell.gold .v { color: var(--gold); }

/* body */
.wd-body { flex: 1; display: flex; gap: 10px; margin-top: 10px; min-height: 0; }
.wd-rail { width: 58px; flex: none; --c: 14px; clip-path: polygon(var(--c) 0, 100% 0, 100% 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-lo) 80%, #000), var(--bg-lo)); box-shadow: inset -1px 0 0 #ffffff12;
  display: flex; flex-direction: column; align-items: center; padding-top: 4px; }
.wd-railbtn { width: 58px; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; position: relative; color: var(--muted); }
.wd-railbtn .ico { width: 40px; height: 30px; --c: 8px; display: grid; place-items: center; }
.wd-railbtn .lb { font-size: 10px; font-weight: 700; }
.wd-railbtn.on { color: var(--accent); }
.wd-railbtn.on .ico { --k: var(--accent); --ki: var(--accent-ink); }
.wd-railbtn.on::before { content: ""; position: absolute; left: 0; top: 13px; width: 4px; height: 26px; background: var(--accent); border-radius: 0 3px 3px 0; box-shadow: 0 0 8px var(--accent); }
.wd-railbtn:hover:not(.on) { color: var(--sub); }
.wd-rail .wd-rail-fill { flex: 1; }
.wd-rail .wd-railbtn.cam { height: 46px; margin-bottom: 8px; color: var(--accent); }

.wd-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; --c: 14px;
  background: linear-gradient(180deg, var(--bg-lo), color-mix(in srgb, var(--bg-lo) 76%, #000)); box-shadow: inset 0 1px 0 #0009, inset 0 -1px 0 color-mix(in srgb, var(--text) 8%, transparent); }
.wd-hdr { height: 38px; flex: none; display: flex; align-items: center; gap: 9px; padding: 0 14px; --c: 12px;
  clip-path: polygon(var(--c) 0, 100% 0, 100% 100%, 0 100%, 0 var(--c));
  background: linear-gradient(180deg, color-mix(in srgb, var(--surf-hi) 94%, var(--accent)), color-mix(in srgb, var(--bg-lo) 75%, #000)); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--accent) 25%, transparent); }
.wd-hdr .t { font-weight: 700; font-size: 15px; letter-spacing: .04em; }
.wd-hdr .h { margin-left: auto; font-size: 11px; color: var(--muted); }
.wd-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 12px 14px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.wd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: start; }
.wd-col { display: flex; flex-direction: column; min-width: 0; }

/* page blocks */
.wd-sec { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px 2px; }
.wd-col > .wd-sec:first-child { margin-top: 2px; }
.wd-sec .tk { width: 6px; height: 13px; background: var(--accent); clip-path: polygon(3px 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%, 0 3px); }
.wd-sec .tx { font-size: 12.5px; font-weight: 700; color: var(--sub); letter-spacing: .05em; white-space: nowrap; }
.wd-sec .rl { flex: 1; height: 1px; background: var(--line); }
.wd-label { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 3px 4px 5px; }
.wd-fold { display: flex; align-items: center; gap: 8px; padding: 9px 10px; margin: 9px 0 6px; --c: 9px; cursor: pointer; }
.wd-fold .tx { font-size: 13px; font-weight: 700; color: var(--sub); }
.wd-fold.open .tx { color: var(--text); }
.wd-fold .sm { flex: 1; text-align: right; font-size: 12px; color: var(--value); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-fold.open { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--accent) 32%, transparent); }

.wd-row { position: relative; display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 4px 8px 4px 12px; margin-bottom: 6px; --c: 10px; }
.wd-row.ind { margin-left: 12px; }
.wd-row .im { width: 32px; height: 32px; --c: 7px; display: grid; place-items: center; flex: none; }
.wd-row .im img { width: 27px; height: 27px; object-fit: contain; }
.wd-row .lc { flex: 1; min-width: 0; }
.wd-row .lt { font-size: 14px; font-weight: 700; line-height: 1.3; }
.wd-row .ls { font-size: 11px; color: var(--muted); line-height: 1.3; margin-top: 1px; }
.wd-row .q { width: 18px; height: 18px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); cursor: help; opacity: 0; transition: opacity .15s; }
.wd-row:hover .q, .wd-cell:hover .q { opacity: 1; }
.wd-guideon .wd-row:hover, .wd-guideon .wd-cell:hover { outline: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -1px; }
.wd-group { position: relative; margin-left: 12px; padding-left: 10px; }
.wd-group::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 10px; width: 3px; background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 30%, transparent)); border-radius: 2px; }
.wd-group .wd-row { margin-left: 0; }
.wd-active { --k: var(--danger); }

/* controls */
.wd-tg { width: 56px; height: 30px; --c: 7px; position: relative; cursor: pointer; flex: none; }
.wd-tg .kn { position: absolute; top: 5px; left: 6px; width: 20px; height: 20px; --c: 5px; background: linear-gradient(#f2f2f2, #9a9a9a); transition: left .15s; box-shadow: 0 1px 2px #000a; }
.wd-tg.on .kn { left: 30px; background: linear-gradient(#1a1a1a, #000); box-shadow: inset 0 0 0 2px #0006; }
.wd-seg { display: flex; gap: 2px; padding: 3px; --c: 8px; flex: none; }
.wd-seg .o { padding: 6px 11px; min-width: 52px; text-align: center; font-size: 13px; font-weight: 700; color: var(--sub); cursor: pointer; --c: 6px; white-space: nowrap; }
.wd-seg .o:hover:not(.on) { color: var(--text); }
.wd-seg .o.on { --k: var(--accent); --ki: var(--accent-ink); }
.wd-seg.wide { flex: 1; }
.wd-seg.wide .o { flex: 1; }
.wd-st { display: flex; align-items: center; gap: 4px; flex: none; }
.wd-st .b { width: 42px; height: 42px; --c: 8px; display: grid; place-items: center; cursor: pointer; color: var(--accent); }
.wd-st .b.dis { opacity: .35; cursor: default; }
.wd-st .v { min-width: 92px; text-align: center; font-size: 15px; font-weight: 700; color: var(--value); font-variant-numeric: tabular-nums; }
.wd-st .v.flash { animation: wdflash .3s; }
@keyframes wdflash { 0% { transform: scale(1.18); } 100% { transform: scale(1); } }
.wd-job { width: 44px; height: 44px; --c: 9px; display: grid; place-items: center; cursor: pointer; flex: none; }
.wd-job.busy { opacity: .55; cursor: not-allowed; }
.wd-chips { display: grid; gap: 6px; margin-bottom: 6px; }
.wd-chip { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 4px 8px; --c: 8px; font-size: 13px; font-weight: 700; color: var(--sub); cursor: pointer; text-align: center; }
.wd-chip img { width: 26px; height: 26px; object-fit: contain; }
.wd-chip.on { color: var(--text); --k: var(--accent); }
.wd-chip .ck { color: var(--accent); font-weight: 700; }
.wd-btnrow { display: flex; gap: 6px; margin-bottom: 6px; }
.wd-sbtn { flex: 1; height: 36px; --c: 7px; display: grid; place-items: center; font-weight: 700; font-size: 13px; cursor: pointer; }
.wd-act { cursor: pointer; }
.wd-act .chev { color: var(--muted); font-size: 18px; padding-right: 4px; }
.wd-themes { display: flex; gap: 12px; padding: 10px 12px; --c: 10px; margin-bottom: 6px; }
.wd-th { width: 42px; height: 42px; --c: 9px; display: grid; place-items: center; cursor: pointer; position: relative; }
.wd-th i { width: 18px; height: 18px; border-radius: 5px; display: block; }
.wd-th.on { box-shadow: inset 0 0 0 2px var(--accent); }
.wd-th .nm { position: absolute; top: 46px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.wd-slider { padding: 9px 12px 8px; --c: 10px; margin-bottom: 7px; }
.wd-slider .hd { display: flex; font-size: 14px; font-weight: 700; }
.wd-slider .hd span:last-child { margin-left: auto; color: var(--value); }
.wd-slider .rw { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.wd-slider .pm { width: 38px; height: 38px; border-radius: 9px; background: #ffffff1a; display: grid; place-items: center; font-size: 20px; font-weight: 700; cursor: pointer; }
.wd-slider input { flex: 1; accent-color: var(--value); }
.wd-perm { padding: 10px 12px; --c: 10px; font-size: 12.5px; color: var(--sub); line-height: 1.7; }
.wd-tpl { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 4px 8px 4px 12px; margin-bottom: 5px; --c: 9px; cursor: pointer; }
.wd-tpl .n { font-size: 13px; font-weight: 700; }
.wd-tpl .s { font-size: 10.5px; color: var(--muted); }
.wd-tpl .tag { margin-left: auto; font-size: 10.5px; font-weight: 700; background: var(--gold); color: #2a1a00; padding: 2px 6px; border-radius: 4px; }
.wd-setcard { padding: 10px; --c: 9px; margin-bottom: 6px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.wd-setcard div { --c: 6px; height: 54px; display: grid; place-items: center; font-size: 11px; color: var(--sub); text-align: center; }
.wd-gobtn { display: flex; gap: 6px; margin-bottom: 6px; }
.wd-gobtn > div { height: 42px; --c: 8px; display: grid; place-items: center; font-weight: 700; font-size: 13.5px; cursor: pointer; }

/* collapsed dot */
.wd-dot { position: absolute; right: 22px; top: 46%; width: 54px; height: 54px; z-index: 3; display: none; cursor: pointer; border-radius: 14px; background: #5c24d2;
  box-shadow: 0 4px 14px #0009, inset 0 1px 0 #fff6; place-items: center; }
.wd-dot.show { display: grid; }
.wd-dot img { width: 46px; height: 46px; }
.wd-dot-round { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; white-space: nowrap; }

/* tooltip / modal / toast */
.wd-tip { position: absolute; z-index: 9; max-width: 330px; padding: 10px 12px; border-radius: 10px; background: #0d1114f2; color: #eef; font-size: 13px; line-height: 1.55;
  box-shadow: 0 8px 26px #000b, inset 0 0 0 1px #ffffff22; pointer-events: none; opacity: 0; transition: opacity .12s; }
.wd-tip b { color: #fff; display: block; margin-bottom: 3px; font-size: 13.5px; }
.wd-tip .more { margin-top: 6px; font-size: 11.5px; color: #9ab; }
.wd-tip.show { opacity: 1; }
.wd-modal { position: absolute; inset: 0; z-index: 10; display: none; align-items: center; justify-content: center; background: #000a; }
.wd-modal.show { display: flex; }
.wd-modal-card { width: min(560px, 92%); max-height: 86%; display: flex; flex-direction: column; background: #12171b; border-radius: 14px; box-shadow: 0 20px 50px #000c, inset 0 0 0 1px #ffffff1f; color: #e8eef0; }
.wd-modal-h { display: flex; align-items: center; padding: 14px 16px 10px; font-weight: 700; font-size: 17px; border-bottom: 1px solid #ffffff14; }
.wd-modal-h button { margin-left: auto; background: none; border: 0; color: #9ab; font-size: 18px; cursor: pointer; }
.wd-modal-b { padding: 12px 16px; overflow: auto; font-size: 14px; line-height: 1.7; }
.wd-modal-b h4 { margin: 12px 0 4px; font-size: 14px; color: var(--accent); }
.wd-modal-b ul { margin: 4px 0; padding-left: 20px; }
.wd-modal-b .tipbox { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: #ffffff0d; font-size: 13px; }
.wd-modal-f { padding: 10px 16px 14px; display: flex; justify-content: flex-end; gap: 8px; }
.wd-modal-f button { font: inherit; font-weight: 700; padding: 7px 18px; border-radius: 8px; border: 0; cursor: pointer; background: var(--accent); color: var(--accent-ink); }
.wd-modal-f button.ghost { background: #ffffff18; color: #fff; }
.wd-toast { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 11; background: #222a; backdrop-filter: blur(4px); color: #fff; padding: 8px 16px; border-radius: 20px;
  font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; box-shadow: inset 0 0 0 1px #ffffff26; white-space: nowrap; }
.wd-toast.show { opacity: 1; }
.wd-tour-hl { outline: 2px solid #ffd54a !important; outline-offset: 2px; box-shadow: 0 0 0 9999px #0007 !important; position: relative; z-index: 5; }
.wd-ico { display: block; }
