/* WiiBlox Studio: the December 2007 Roblox Studio frame (Codejock "Whidbey"
   style). Colours are CSS variables set by js/studio.js from DATA2007.whidbey,
   which tools/studio2007/build_studio_data.py computes with the client's own
   WhidbeyStyle formulas. Sizes come from the client source or were measured
   on the January 2007 screenshot (assets/original/studio-2007-screenshots). */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
	font: 11px Tahoma, Verdana, "Segoe UI", sans-serif;
	color: var(--buttonText);
	background: var(--face);
	user-select: none;
	-webkit-user-select: none;
	cursor: default;
}
img { -webkit-user-drag: none; }
#frame { display: flex; flex-direction: column; height: 100%; }

/* ---- command bars (dock area: horizontal dockBarLight -> dockBarDark) ---- */
#commandbars { background: var(--dockGradient); padding: 0 0 1px; flex: none; }
.dockrow { display: flex; align-items: stretch; min-height: 25px; padding-left: 2px; }
.menubar { display: flex; align-items: center; height: 22px; padding: 1px 0 1px 2px; }
.menubar .mitem { padding: 2px 6px 3px; border: 1px solid transparent; white-space: nowrap; }
.menubar .mitem.hot { background: var(--highlightFace); border-color: var(--highlightBorder); }
.menubar .mitem.open { background: var(--menuBarFace); border-color: var(--menuBarBorder); border-bottom-color: var(--menuBarFace); position: relative; z-index: 31; }
.toolbar {
	display: flex; align-items: center; height: 25px; margin: 0 1px 0 0; padding: 1px 2px 2px 10px; position: relative;
	background: var(--toolbarBackground);
	border-radius: 3px; box-shadow: inset 0 -1px 0 var(--toolbarBottom);
}
.toolbar .gripper { position: absolute; left: 3px; top: 5px; bottom: 6px; width: 4px; background-repeat: repeat-y; }
.tbutton { width: 23px; height: 22px; border: 1px solid transparent; display: flex; align-items: center; justify-content: center; }
.tbutton i { display: block; width: 16px; height: 16px; background-repeat: no-repeat; }
.tbutton.std i { width: 15px; }
.tbutton.hot { background: var(--highlightFace); border-color: var(--highlightBorder); }
.tbutton.pushed { background: var(--highlightPushed); border-color: var(--highlightPushedBorder); }
.tbutton.checked { background: var(--highlightChecked); border-color: var(--highlightCheckedBorder); }
.tbutton.checked.hot { background: var(--highlightPushed); }
.tbutton.disabled i { filter: grayscale(1) opacity(0.45); }
.tsep { width: 6px; align-self: stretch; position: relative; }
.tsep::after { content: ""; position: absolute; left: 2px; top: 4px; bottom: 4px; width: 1px; background: var(--separator); }

/* ---- popup menus ---- */
.popup {
	position: fixed; z-index: 30; min-width: 140px; padding: 1px 0;
	background: var(--menuBarFace); border: 1px solid var(--menuBarBorder);
	box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.28);
}
.popup .gutter { position: absolute; left: 1px; top: 2px; bottom: 2px; width: 24px; background: linear-gradient(to right, var(--commandBarLight), var(--commandBarDark)); }
.popup .pitem { position: relative; display: flex; align-items: center; height: 22px; padding: 0 18px 0 32px; border: 1px solid transparent; margin: 0 2px; white-space: nowrap; }
.popup .pitem .key { margin-left: auto; padding-left: 26px; }
.popup .pitem.hot { background: var(--highlightFace); border-color: var(--highlightBorder); }
.popup .pitem.disabled { color: var(--menuBarGrayText); }
.popup .pitem.disabled.hot { background: var(--menuBarFace); }
.popup .pitem.sub::after { content: ""; position: absolute; right: 7px; top: 7px; border: 4px solid transparent; border-left-color: currentColor; border-right: 0; }
.popup .pitem .check { position: absolute; left: 5px; top: 2px; width: 16px; height: 16px; border: 1px solid var(--highlightCheckedBorder); background: var(--highlightChecked); }
.popup .pitem .check::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #000; border-width: 0 2px 2px 0; transform: rotate(40deg); }
.popup .psep { height: 3px; margin: 1px 0 1px 32px; border-top: 1px solid var(--separator); position: relative; top: 1px; }

/* ---- main area ---- */
#main { flex: 1; display: flex; min-height: 0; }
#center { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dock { display: flex; flex-direction: column; flex: none; background: var(--face); min-width: 0; min-height: 0; }
#dock-right { width: 250px; padding: 0 0 0 3px; }
#dock-left { width: 280px; padding: 0 3px 0 0; display: none; }
#dock-bottom { height: 200px; padding: 3px 0 0; display: none; }
.vsplit { flex: none; height: 4px; cursor: row-resize; }
.hsplit { flex: none; width: 4px; cursor: col-resize; }

/* ---- docking panes ---- */
.pane { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.pane.hidden { display: none; }
.pcaption {
	flex: none; height: 19px; display: flex; align-items: center; padding: 0 2px 0 4px;
	background: var(--captionInactiveBackground); color: var(--paneCaptionInactiveText);
	border: 1px solid var(--paneCaptionBorder); border-bottom: 1px solid var(--darkShadow);
}
.pane.active .pcaption { background: var(--captionActiveBackground); color: var(--paneCaptionActiveText); }
.pcaption .ptitle { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pcaption .pbtn { width: 14px; height: 14px; margin-left: 2px; display: flex; align-items: center; justify-content: center; border: 1px solid transparent; }
.pcaption .pbtn:hover { background: var(--highlightFace); border-color: var(--highlightBorder); color: var(--buttonText); }
.pcaption .pbtn svg { display: block; }
.pbody { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--paneCaptionBorder); background: var(--face); }

/* ---- Explorer ---- */
.tree { flex: 1; overflow: auto; background: var(--window); color: var(--windowText); border: 1px solid var(--staticFrame); margin: 0; padding: 1px 0; }
.trow { display: flex; align-items: center; height: 18px; white-space: nowrap; }
.trow .tbox { width: 16px; height: 16px; flex: none; display: flex; align-items: center; justify-content: center; }
.trow .tbox span { width: 9px; height: 9px; border: 1px solid var(--shadow); background: var(--window); position: relative; }
.trow .tbox span::before { content: ""; position: absolute; left: 1px; top: 3px; width: 5px; height: 1px; background: #000; }
.trow .tbox.plus span::after { content: ""; position: absolute; left: 3px; top: 1px; width: 1px; height: 5px; background: #000; }
.trow .ticon { width: 16px; height: 16px; flex: none; margin-right: 3px; background-image: url(../img/explorer_133.png); }
.trow .tname { padding: 1px 2px; border: 1px dotted transparent; }
.trow.selected .tname { background: var(--selectionInactive); color: var(--windowText); }
.tree:focus .trow.selected .tname { background: var(--highlight); color: var(--highlightText); }
.trow.focus .tname { border-color: #000; }
.trow .tname input { font: inherit; width: 140px; border: 1px solid #000; padding: 0 1px; }
.trow.droptarget .tname { outline: 1px solid var(--highlight); }

/* ---- Properties ---- */
.selcaption { flex: none; height: 22px; margin: 1px; padding: 0 4px; display: flex; align-items: center; background: var(--face);
	border-top: 1px solid var(--buttonHighlight); border-left: 1px solid var(--buttonHighlight); border-right: 1px solid var(--shadow); border-bottom: 1px solid var(--shadow); }
.pgbar { flex: none; height: 26px; display: flex; align-items: center; padding: 0 2px; border-bottom: 1px solid var(--buttonHighlight); }
.pgbar .tbutton { width: 23px; height: 22px; }
.pgbar .tbutton i { width: 16px; height: 16px; }
.pgrid { flex: 1; overflow-y: auto; overflow-x: hidden; background: var(--face); border: 1px solid var(--shadow); margin-top: 1px; color: var(--windowText); }
.pgcat { height: 18px; display: flex; align-items: flex-start; font-weight: bold; position: relative; }
.pgcat .glyph { width: 14px; height: 16px; flex: none; display: flex; align-items: center; justify-content: center; }
.pgcat .ctext { height: 16px; line-height: 16px; padding-left: 0; }
.pgcat::after { content: ""; position: absolute; left: 0; right: 0; top: 16px; height: 1px; background: linear-gradient(to right, var(--face), var(--window)); }
.glyph i { display: block; width: 12px; height: 12px; background-image: url(../img/tree_9550.png); }
.glyph i.minus { background-position: 0 0; }
.glyph i.plus { background-position: -12px 0; }
.pgrow { height: 17px; display: flex; padding-bottom: 1px; }
.pgrow .margin { width: 14px; flex: none; display: flex; align-items: center; justify-content: center; }
.pgrow .pname { width: calc(50% - 14px); flex: none; background: var(--window); padding: 0 3px; line-height: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-right: 1px; }
.pgrow .pname.sub { padding-left: 14px; }
.pgrow .pvalue { flex: 1; min-width: 0; background: var(--window); display: flex; align-items: center; padding: 0 0 0 3px; overflow: hidden; white-space: nowrap; position: relative; }
.pgrow.readonly .pname, .pgrow.readonly .pvalue { color: var(--grayText); }
.pgrow.selected .pname { background: var(--highlight); color: var(--highlightText); }
.pvalue .vtext { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.pvalue input.edit { font: inherit; border: 0; padding: 0; margin: 0; width: 100%; height: 15px; outline: none; background: var(--window); color: var(--windowText); }
.pvalue .swatch { width: 20px; height: 12px; border: 1px solid #000; margin-right: 6px; flex: none; }
.pvalue .combo { width: 15px; height: 15px; flex: none; margin-left: 2px; display: flex; align-items: center; justify-content: center;
	background: var(--face); border: 1px solid; border-color: var(--buttonHighlight) var(--darkShadow) var(--darkShadow) var(--buttonHighlight); }
.pvalue .combo::after { content: ""; border: 3px solid transparent; border-top: 3px solid #000; border-bottom: 0; margin-top: 1px; }
.pvalue .combo.dots::after { content: "..."; border: 0; font-size: 9px; line-height: 6px; margin: 0; }
.pvalue .chk { width: 12px; height: 12px; background-image: url(../img/tree_9550.png); background-position: -24px 0; flex: none; }
.pvalue .chk.on { background-position: -36px 0; }
.pgrow.readonly .pvalue .chk { background-position: -48px 0; }
.pgrow.readonly .pvalue .chk.on { background-position: -60px 0; }
.dropdown { position: fixed; z-index: 40; background: var(--window); border: 1px solid #000; max-height: 240px; overflow-y: auto; }
.dropdown div { padding: 1px 4px; white-space: nowrap; }
.dropdown div.hot { background: var(--highlight); color: var(--highlightText); }

/* BrickColor picker: 8 x 4 cells of 32 px, 3 px inset (ColorSelector, 260 x 136) */
.colorpicker { position: fixed; z-index: 40; width: 260px; padding: 2px; background: var(--face);
	border: 1px solid; border-color: var(--buttonLight) var(--darkShadow) var(--darkShadow) var(--buttonLight); }
.colorpicker .cpgrid { display: grid; grid-template-columns: repeat(8, 32px); grid-auto-rows: 32px; height: 128px; }
.colorpicker .cpgrid div { margin: 3px; border: 1px solid var(--shadow); }
.colorpicker .cpgrid div:hover, .colorpicker .cpgrid div.current { outline: 2px solid var(--highlight); }
/* WiiBlox: every BrickColor by name under the 2007 grid */
.colorpicker .cpsearch { width: 100%; box-sizing: border-box; margin: 3px 0; }
.colorpicker .cplist { height: 200px; overflow-y: auto; background: var(--window, #fff); border: 1px solid var(--shadow); }
.colorpicker .cprow { display: flex; align-items: center; height: 18px; padding: 0 3px; cursor: default; white-space: nowrap; }
.colorpicker .cprow:hover { background: var(--highlight, #316ac5); color: var(--highlightText, #fff); }
.colorpicker .cprow.current { font-weight: bold; }
.colorpicker .cpswatch { width: 14px; height: 12px; border: 1px solid #000; margin-right: 5px; flex: none; }
.colorpicker .cpnum { margin-left: auto; opacity: 0.6; padding-left: 6px; }
/* WiiBlox: content chooser (uploads wbxassetid://, game files wbxasset://) */
.chooser .chooserrow { display: flex; align-items: center; margin-bottom: 6px; }
.chooser .chooserrow input { flex: 1; }
.chooser .choosertabs { display: flex; gap: 4px; margin-bottom: 4px; }
.chooser .choosertabs .btn.on { font-weight: bold; box-shadow: inset 1px 1px 0 var(--shadow); }
.chooser .chooserbar { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.chooser .choosersearch { width: 100%; box-sizing: border-box; margin-bottom: 4px; }
.chooser .chooserlist { height: 280px; overflow-y: auto; background: var(--window, #fff); border: 1px solid var(--shadow); }
.chooser .chooseritem { display: flex; align-items: center; gap: 6px; padding: 2px 4px; min-height: 20px; cursor: default; }
.chooser .chooseritem.selected { background: var(--highlight, #316ac5); color: var(--highlightText, #fff); }
.chooser .chooseritem img { border: 1px solid var(--shadow); background: #fff; flex: none; }
.chooser .chooseritem .detail { margin-left: auto; opacity: 0.7; font-size: 10px; }
.chooser .choosericon { width: 32px; text-align: center; font-size: 18px; flex: none; }
.chooser .choosernone { padding: 6px; }
.chooser .choosernote { min-height: 28px; margin-top: 4px; white-space: pre-wrap; }

/* ---- workspace (documents) ---- */
#doctabs { flex: none; height: 22px; display: flex; align-items: flex-end; padding: 0 2px; background: var(--tabStrip); border-bottom: 1px solid var(--tabFrameBorder); }
.doctab { height: 19px; padding: 0 8px; margin-right: 1px; display: flex; align-items: center; border: 1px solid var(--tabBorderShadow, var(--shadow)); border-bottom: 0; background: var(--tabInactive); color: var(--buttonText); position: relative; top: 1px; }
.doctab.active { background: var(--window); color: var(--windowText); height: 21px; border-color: var(--tabFrameBorder); font-weight: bold; }
.doctab .x { margin-left: 8px; width: 12px; text-align: center; }
#docs { flex: 1; position: relative; min-height: 0; background: var(--appWorkspace); }
.doc { position: absolute; inset: 0; display: none; }
.doc.active { display: block; }
#view3d canvas { display: block; outline: none; }
#viewhint { position: absolute; left: 6px; bottom: 4px; color: #fff; text-shadow: 1px 1px 0 #000; pointer-events: none; font-size: 11px; }

/* ---- script editor (Scintilla look from ScriptDoc.cpp) ---- */
.scripted { position: absolute; inset: 0; background: #fff; overflow: auto; font: 12px Verdana, sans-serif; line-height: 15px; }
.scripted .lines { white-space: pre; position: absolute; left: 0; top: 0; width: 32px; min-height: 100%; background: var(--face); color: #000; text-align: right; padding: 0 4px 0 0; }
.scripted .sel-margin { position: absolute; left: 32px; top: 0; width: 16px; min-height: 100%; background: var(--face); opacity: 0.6; }
.scripted .code { position: absolute; left: 50px; top: 0; right: 0; min-height: 100%; }
.scripted pre, .scripted textarea { margin: 0; padding: 0 4px; font: inherit; line-height: inherit; white-space: pre; tab-size: 4; -moz-tab-size: 4; border: 0; }
.scripted pre { position: absolute; inset: 0; pointer-events: none; color: #000; }
.scripted textarea { position: absolute; inset: 0; width: 100%; height: 100%; resize: none; outline: none; background: transparent; color: transparent; caret-color: #000; overflow: hidden; user-select: text; -webkit-user-select: text; }
.scripted .readonly-note { position: absolute; right: 8px; top: 4px; color: var(--grayText); }
.lua-kw { color: #000080; font-weight: bold; }
.lua-str { color: #800080; }
.lua-num { color: #008080; }
.lua-com { color: #008000; }
.lua-op { color: #808000; }

/* ---- Output (StandardOutputView: message box font) ---- */
.output { flex: 1; overflow: auto; background: var(--window); color: var(--windowText); padding: 2px 3px; border: 1px solid var(--staticFrame); white-space: pre-wrap; user-select: text; -webkit-user-select: text; }
.output .info { color: blue; }
.output .warning { color: orange; font-weight: bold; }
.output .error { color: red; font-weight: bold; }

/* ---- status bar ---- */
#statusbar { flex: none; height: 20px; display: flex; align-items: center; padding: 2px 2px 1px; background: var(--face); }
#statusbar .spane { height: 17px; padding: 1px 4px; border: 1px solid var(--statusPane); white-space: nowrap; overflow: hidden; }
#statusbar .spane.main { flex: 1; border-color: transparent; }

/* ---- dialogs (MS Sans Serif 8 = Tahoma 8 on XP) ---- */
.modal { position: fixed; inset: 0; z-index: 50; background: transparent; }
.dialog { position: fixed; z-index: 51; background: var(--face); border: 1px solid; border-color: var(--buttonLight) var(--darkShadow) var(--darkShadow) var(--buttonLight); box-shadow: inset 1px 1px 0 var(--buttonHighlight), inset -1px -1px 0 var(--shadow); padding: 3px; }
.dialog .dtitle { height: 18px; padding: 0 4px; display: flex; align-items: center; font-weight: bold; color: var(--captionText); background: linear-gradient(to right, var(--activeCaption), var(--activeCaption)); margin-bottom: 4px; }
.dialog .dtitle .dx { margin-left: auto; width: 16px; height: 14px; background: var(--face); color: #000; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 10px;
	border: 1px solid; border-color: var(--buttonHighlight) var(--darkShadow) var(--darkShadow) var(--buttonHighlight); }
.dialog .dbody { padding: 6px 8px 8px; }
.dialog .row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dialog input[type=text] { font: inherit; height: 21px; padding: 2px 3px; border: 1px solid var(--staticFrame); background: var(--window); }
.dialog .buttons { display: flex; justify-content: flex-end; gap: 6px; }
.btn { font: inherit; min-width: 75px; height: 23px; background: var(--face); color: var(--buttonText); border: 1px solid; border-color: var(--buttonHighlight) var(--darkShadow) var(--darkShadow) var(--buttonHighlight);
	box-shadow: inset -1px -1px 0 var(--shadow); padding: 0 8px; }
.btn:active { border-color: var(--darkShadow) var(--buttonHighlight) var(--buttonHighlight) var(--darkShadow); box-shadow: inset 1px 1px 0 var(--shadow); }
.btn:focus { outline: 1px dotted #000; outline-offset: -4px; }
.dialog .message { display: flex; gap: 12px; align-items: flex-start; max-width: 420px; white-space: pre-wrap; margin-bottom: 12px; }
.about { width: 380px; font: 12px Verdana, Arial, Helvetica, sans-serif; text-align: center; }
.about p { margin: 10px 0; }
.about textarea { width: 100%; height: 6em; font: 11px Verdana, sans-serif; }
.tip { position: fixed; z-index: 60; background: var(--infoBackground); color: var(--infoText); border: 1px solid #000; padding: 1px 3px; white-space: nowrap; pointer-events: none; }
/* mnemonics show while Alt is held (Windows XP default) */
u.mn { text-decoration: none; }
body.alt u.mn { text-decoration: underline; }

/* WiiBlox: Insert Object list (search, two columns of classes with their 2007 Explorer icons) */
.insertpanel { width: 400px; }
.insertpanel .dtitle { cursor: move; }
.insertpanel .insertsearch { width: 100%; box-sizing: border-box; margin-bottom: 4px; }
.insertpanel .insertlist { height: 300px; overflow-y: auto; background: var(--window, #fff); border: 1px solid; border-color: var(--shadow) var(--buttonHighlight) var(--buttonHighlight) var(--shadow); display: grid; grid-auto-flow: column; grid-template-columns: 1fr 1fr; align-content: start; }
.insertpanel .insertrow { display: flex; align-items: center; height: 20px; padding: 0 3px; white-space: nowrap; overflow: hidden; cursor: default; }
.insertpanel .insertrow .ticon { width: 16px; height: 16px; flex: none; margin-right: 4px; background-image: url(../img/explorer_133.png); }
.insertpanel .insertrow.selected { background: var(--highlight, #316ac5); color: var(--highlightText, #fff); }
.insertpanel .insertnone { padding: 6px; grid-column: 1 / span 2; }
.insertpanel .insertfoot { display: block; margin-top: 6px; }
