/* Lumerical FDTD Solutions 2022 R1 — GUI reconstruction.
 * NOTE: no reference screenshot is available on this host (the Lumerical GUI is not
 * installed). The layout below is rebuilt from the vendor's public documentation:
 * menu bar (File … Help), run/stop + object library + monitor + view toolbars,
 * left Objects tree (FDTD / Objects / Analysis groups / Monitors), right Objects
 * library palette, centre layout editor and the bottom script-editor dock.
 * provenance = "reference-unavailable" is surfaced in the toolbar and status bar. */

:root {
  --lum-bg: #eef0f2;
  --lum-chrome: #f3f4f5;
  --lum-panel: #f7f8f9;
  --lum-panel2: #eceef0;
  --lum-border: #b8bec5;
  --lum-border-soft: #d6dadd;
  --lum-text: #1f2328;
  --lum-text-dim: #5d676f;
  --lum-text-dis: #9aa2a9;
  --lum-accent: #1466b8;
  --lum-accent-soft: #cfe3f7;
  --lum-sel: #cfe3f7;
  --lum-orange: #d98a1f;
  --lum-green: #2f8f46;
  --lum-red: #c0392b;
  --font-ui: "Rubik", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "DejaVu Sans Mono", monospace;
  --h-title: 26px; --h-menu: 23px; --h-toolbar: 40px; --h-status: 22px;
  --w-left: 272px; --w-right: 252px; --h-bottom: 188px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font-ui); font-size: 12px; color: var(--lum-text);
  background: var(--lum-bg); user-select: none; -webkit-font-smoothing: antialiased;
}
#app { height: 100%; display: flex; flex-direction: column; }

/* ------------------------------------------------------------- title bar */
.titlebar {
  height: var(--h-title); flex: 0 0 var(--h-title);
  display: flex; align-items: center; gap: 8px; padding-left: 8px;
  background: linear-gradient(#fbfbfc, #eff1f3);
  border-bottom: 1px solid var(--lum-border-soft);
  font-size: 12px; color: #2c3238;
}
.titlebar .appico { width: 16px; height: 16px; flex: 0 0 16px; }
.titlebar .ttl { font-weight: 500; }
.titlebar .ttl .dim { color: var(--lum-text-dim); font-weight: 400; }
.titlebar .spacer { flex: 1; }
.titlebar .sysbtn { width: 44px; height: var(--h-title); display: grid; place-items: center; color: #2c3238; }
.titlebar .sysbtn:hover { background: #dfe4e8; }
.titlebar .sysbtn.close:hover { background: #c0392b; color: #fff; }

/* ---------------------------------------------------------------- menubar */
.menubar {
  height: var(--h-menu); flex: 0 0 var(--h-menu);
  display: flex; align-items: stretch; padding-left: 4px;
  background: var(--lum-chrome); border-bottom: 1px solid var(--lum-border-soft);
}
.menubar .m {
  display: flex; align-items: center; padding: 0 9px; font-size: 12px; color: #23282d;
  cursor: default; white-space: nowrap;
}
.menubar .m:hover, .menubar .m.open { background: var(--lum-accent-soft); }

/* menubar popups are appended to body */
.menupop {
  position: fixed; z-index: 60; background: #fbfbfc; border: 1px solid #a9b0b7;
  box-shadow: 0 4px 14px rgba(0,0,0,.22); padding: 3px 0; min-width: 190px;
}
.menupop .mi {
  height: 22px; display: flex; align-items: center; gap: 8px;
  padding: 0 22px 0 24px; font-size: 12px; color: #23282d; position: relative;
  white-space: nowrap;
}
.menupop .mi:hover { background: var(--lum-accent-soft); }
.menupop .mi .accel { margin-left: auto; color: var(--lum-text-dim); font-size: 11px; padding-left: 22px; }
.menupop .mi .arrow { margin-left: auto; color: var(--lum-text-dim); padding-left: 18px; }
.menupop .mi.disabled { color: var(--lum-text-dis); }
.menupop .mi.disabled:hover { background: transparent; }
.menupop .mi .chk { position: absolute; left: 7px; color: #2d6ea8; font-size: 11px; }
.menupop .sep { height: 1px; background: #d5d9dc; margin: 3px 2px; }
.menupop .infer { position: absolute; right: 6px; top: 6px; font-size: 8px; color: #a98b4a; border: 1px solid #d9c69a; border-radius: 2px; padding: 0 2px; line-height: 9px; }

/* --------------------------------------------------------------- toolbar */
.toolbar {
  height: var(--h-toolbar); flex: 0 0 var(--h-toolbar);
  display: flex; align-items: center; gap: 0; padding: 0 8px;
  background: linear-gradient(#fafbfc, #eff1f3);
  border-bottom: 1px solid var(--lum-border);
}
.toolbar .tbgrp { display: flex; align-items: center; gap: 2px; padding: 0 7px; position: relative; }
.toolbar .tbgrp + .tbgrp::before {
  content: ""; position: absolute; left: -1px; top: 7px; bottom: 7px; width: 1px; background: #d3d7da;
}
.toolbar .tbtn {
  width: 26px; height: 26px; display: grid; place-items: center; border-radius: 3px;
  color: #3a444d; position: relative; cursor: default;
}
.toolbar .tbtn:hover { background: #dde6ef; border: 1px solid #b9c8d8; width: 26px; height: 26px; }
.toolbar .tbtn:active { background: #c9dcef; }
.toolbar .tbtn .dd { position: absolute; right: 1px; bottom: 1px; width: 0; height: 0; border-left: 4px solid transparent; border-top: 4px solid #4a545d; }
.toolbar .tbtn svg { width: 18px; height: 18px; display: block; }
.toolbar .tbtn.run svg { color: var(--lum-green); }
.toolbar .tbtn.stop svg { color: var(--lum-red); }
.toolbar .tsep { width: 1px; height: 24px; background: #d3d7da; margin: 0 6px; }
.toolbar .spacer { flex: 1; }
.toolbar .provchip {
  display: flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
  border: 1px solid #d8b26a; border-radius: 3px; background: #fdf5e3;
  color: #7a5a12; font-size: 11px; white-space: nowrap;
}
.toolbar .provchip .dot { width: 7px; height: 7px; border-radius: 50%; background: #d98a1f; }
.toolbar .provchip .en { color: #96753a; font-family: var(--font-mono); font-size: 10px; }

/* -------------------------------------------------------------- workarea */
.workarea { flex: 1 1 auto; display: flex; min-height: 0; }
.splitter.v { width: 5px; flex: 0 0 5px; background: #e4e7e9; border-left: 1px solid #cfd4d8; border-right: 1px solid #cfd4d8; cursor: col-resize; }
.splitter.h { height: 5px; flex: 0 0 5px; background: #e4e7e9; border-top: 1px solid #cfd4d8; border-bottom: 1px solid #cfd4d8; cursor: row-resize; }
.splitter:hover { background: #d3dde7; }

.leftdock { width: var(--w-left); flex: 0 0 var(--w-left); display: flex; flex-direction: column; background: var(--lum-panel); min-height: 0; }
.rightdock { width: var(--w-right); flex: 0 0 var(--w-right); display: flex; flex-direction: column; background: var(--lum-panel); min-height: 0; }
.panehead {
  height: 24px; flex: 0 0 24px; display: flex; align-items: center; gap: 6px;
  padding: 0 6px; background: var(--lum-panel2); border-bottom: 1px solid var(--lum-border-soft);
  font-size: 11px; color: #3d464e;
}
.panehead .ptitle { font-weight: 500; letter-spacing: .2px; }
.panehead .paneacts { margin-left: auto; display: flex; gap: 2px; color: #5d676f; }
.panehead .paneacts .pbtn { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 2px; }
.panehead .paneacts .pbtn:hover { background: #dfe4e8; }

/* tree */
.treebox { flex: 1 1 auto; overflow: auto; padding: 3px 0 40px; background: #fff; }
.tnode { height: 21px; display: flex; align-items: center; gap: 4px; padding-right: 6px; white-space: nowrap; cursor: default; }
.tnode:hover { background: #eef4fb; }
.tnode.sel { background: var(--lum-sel); outline: 1px solid #a9c8e8; outline-offset: -1px; }
.tnode .tw { width: 13px; flex: 0 0 13px; display: grid; place-items: center; color: #6b747c; font-size: 9px; }
.tnode .ico { width: 15px; height: 15px; flex: 0 0 15px; display: grid; place-items: center; }
.tnode .ico svg { width: 14px; height: 14px; }
.tnode .lbl { font-size: 12px; color: #23282d; overflow: hidden; text-overflow: ellipsis; }
.tnode.group .lbl { font-weight: 500; color: #2b3238; }
.tnode.group { background: #f3f5f7; border-bottom: 1px solid #eceff1; }
.tnode .cnt { color: var(--lum-text-dis); font-size: 10px; margin-left: 3px; }
.tnode .tbadge { margin-left: auto; font-size: 9px; color: #8a7a4f; border: 1px solid #ddd0a8; border-radius: 2px; padding: 0 2px; line-height: 10px; }

/* objects library */
.libsearch { padding: 4px 5px; border-bottom: 1px solid var(--lum-border-soft); background: #fff; }
.libsearch input {
  width: 100%; height: 20px; font: 11px var(--font-ui); padding: 0 6px; color: #23282d;
  border: 1px solid var(--lum-border); border-radius: 2px; background: #fff; outline: none;
}
.libsearch input:focus { border-color: var(--lum-accent); box-shadow: 0 0 0 1px #bcd7f2 inset; }
.libbox { flex: 1 1 auto; overflow: auto; background: #fff; padding-bottom: 30px; }
.libcat { height: 22px; display: flex; align-items: center; gap: 5px; padding-left: 6px; background: #f3f5f7; border-bottom: 1px solid #eceff1; font-size: 11px; font-weight: 500; color: #3d464e; }
.libcat .tw { width: 11px; color: #6b747c; font-size: 9px; }
.libcat .n { margin-left: auto; padding-right: 7px; color: #9aa2a9; font-weight: 400; font-size: 10px; }
.libitem { height: 21px; display: flex; align-items: center; gap: 6px; padding-left: 20px; cursor: default; }
.libitem:hover { background: #eef4fb; }
.libitem .ico { width: 14px; height: 14px; display: grid; place-items: center; }
.libitem .ico svg { width: 13px; height: 13px; }
.libitem .lbl { font-size: 12px; color: #2c3238; }
.libitem .add { margin-left: auto; color: #b7bfc6; font-size: 12px; padding-right: 8px; }
.libitem:hover .add { color: var(--lum-accent); }
.libhidden { display: none; }

/* centre: view toolbar + layout editor */
.centerwrap { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #23282e; }
.viewtoolbar {
  height: 28px; flex: 0 0 28px; display: flex; align-items: center; gap: 4px; padding: 0 6px;
  background: #2b3138; border-bottom: 1px solid #1a1e23; color: #c3ccd4;
}
.viewtoolbar .vtlabel { font-size: 10px; color: #8f9aa4; letter-spacing: .4px; text-transform: uppercase; padding-right: 4px; }
.viewtoolbar .vbtn {
  height: 20px; min-width: 22px; padding: 0 6px; display: flex; align-items: center; gap: 4px;
  border: 1px solid #3c434b; border-radius: 2px; background: #343b43; color: #ccd5dd; font-size: 11px; cursor: default;
}
.viewtoolbar .vbtn:hover { background: #3f4852; border-color: #566270; }
.viewtoolbar .vbtn.active { background: #1f5f9e; border-color: #2e77bb; color: #fff; }
.viewtoolbar .vbtn svg { width: 13px; height: 13px; }
.viewtoolbar .spacer { flex: 1; }
.viewtoolbar .vmsg { font-size: 10px; color: #7f8b96; font-family: var(--font-mono); }

.layout { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
#gfx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viewlabel { position: absolute; left: 10px; top: 8px; font-size: 11px; color: #a9b6c2; font-family: var(--font-mono); letter-spacing: .3px; pointer-events: none; }
.hud { position: absolute; left: 10px; bottom: 8px; display: flex; gap: 14px; font-size: 10px; color: #8d99a4; font-family: var(--font-mono); pointer-events: none; }
.hud b { color: #c3ccd4; font-weight: 500; }
.layout .pickbox { position: absolute; border: 1px dashed #e8a33d; pointer-events: none; }

/* bottom dock */
.bottomdock { height: var(--h-bottom); flex: 0 0 var(--h-bottom); display: flex; flex-direction: column; background: #1d2126; min-height: 0; }
.tabstrip {
  height: 25px; flex: 0 0 25px; display: flex; align-items: stretch; gap: 1px; padding: 0 6px;
  background: #2b3138; border-bottom: 1px solid #14181c;
}
.tabstrip .tab {
  display: flex; align-items: center; padding: 0 12px; font-size: 11px; color: #9aa6b1;
  background: #262c33; border: 1px solid #363d45; border-bottom: none; border-radius: 3px 3px 0 0; margin-top: 3px;
}
.tabstrip .tab:hover { color: #cfd9e2; }
.tabstrip .tab.active { background: #1d2126; color: #e6edf3; border-color: #3f4852; }
.tabstrip .tab .x { margin-left: 8px; font-size: 10px; color: #6f7a85; }
.tabstrip .spacer { flex: 1; }
.tabstrip .pathinfo { display: flex; align-items: center; font-size: 10px; color: #6f7a85; font-family: var(--font-mono); padding-right: 8px; }
.scriptwrap { flex: 1 1 auto; overflow: auto; min-height: 0; }
.scriptview { display: flex; font: 11.5px/17px var(--font-mono); background: #1d2126; color: #d5dde5; }
.scriptview .gutter {
  flex: 0 0 46px; text-align: right; padding: 6px 8px 40px 0; color: #5c6873;
  background: #191d21; border-right: 1px solid #2c333a; user-select: none;
}
.scriptview .code { flex: 1 1 auto; padding: 6px 10px 40px; white-space: pre; overflow: visible; }
.scriptview .ln { display: block; min-height: 17px; }
.scriptview .ln.hl { background: #26313c; outline: 1px solid #35506b; outline-offset: -1px; }
.tok-kw { color: #7fb3ff; }
.tok-cmd { color: #8fd3c8; }
.tok-str { color: #b5e08a; }
.tok-num { color: #e6b673; }
.tok-com { color: #6b7885; font-style: italic; }
.tok-var { color: #e2c7a1; }
.msglist { padding: 6px 10px; font: 11.5px/18px var(--font-mono); color: #c7d1da; background: #1d2126; }
.msglist .ln { display: flex; gap: 10px; }
.msglist .t { flex: 0 0 74px; color: #6f7a85; }
.msglist .m-info { color: #c7d1da; }
.msglist .m-ok { color: #8fd3a2; }
.msglist .m-run { color: #9cc4f0; }
.msglist .m-warn { color: #e6b673; }
.outlist { padding: 6px 10px; font: 11.5px/17px var(--font-mono); color: #c7d1da; background: #1d2126; white-space: pre-wrap; }

/* status bar */
.statusbar {
  height: var(--h-status); flex: 0 0 var(--h-status);
  display: flex; align-items: center; gap: 12px; padding: 0 8px;
  background: var(--lum-chrome); border-top: 1px solid var(--lum-border-soft);
  font-size: 11px; color: #3d464e;
}
.statusbar .st { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.statusbar .spacer { flex: 1; }
.statusbar .prov { font-size: 10px; color: #7a5a12; background: #fdf5e3; border: 1px solid #e2c78d; border-radius: 2px; padding: 0 5px; line-height: 15px; }
.statusbar .dot { width: 6px; height: 6px; border-radius: 50%; background: #4a9e5e; }
.statusbar .numchip { font-family: var(--font-mono); font-size: 10px; }

/* ------------------------------------------------ object properties dialog */
.dim { position: fixed; inset: 0; background: rgba(20,24,28,.28); z-index: 80; }
.dialog {
  position: absolute; background: #f4f5f6; border: 1px solid #9aa2aa; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  display: flex; flex-direction: column;
}
.dialog .dlgtitle {
  height: 24px; display: flex; align-items: center; gap: 6px; padding: 0 6px;
  background: linear-gradient(#dbe5ef, #c9d6e4); border-bottom: 1px solid #a9b4c0; font-size: 11px; color: #22303c;
}
.dialog .dlgtitle .x { margin-left: auto; width: 18px; height: 18px; display: grid; place-items: center; color: #3d4a56; }
.dialog .dlgtitle .x:hover { background: #b45b52; color: #fff; }
.dialog .dlgbody { overflow: auto; padding: 8px 10px; background: #fff; }
.dialog .dlgfoot { height: 34px; display: flex; align-items: center; gap: 6px; justify-content: flex-end; padding: 0 8px; border-top: 1px solid #d3d8dc; background: #eef0f2; }
.dialog .winbtn {
  height: 22px; padding: 0 14px; font: 11px var(--font-ui); color: #25303a;
  border: 1px solid var(--lum-border); border-radius: 2px; background: linear-gradient(#fbfcfd, #e9ecef);
}
.dialog .winbtn:hover { background: #dfeaf5; border-color: #8fa8c0; }
.dialog .winbtn.primary { border-color: #6f9fce; background: linear-gradient(#e8f2fb, #cfe3f7); font-weight: 500; }
.dialog.parent { position: fixed; }
.proptable { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.proptable th, .proptable td { text-align: left; padding: 3px 6px; border-bottom: 1px solid #eef0f2; }
.proptable th { color: #5d676f; font-weight: 500; background: #f6f8f9; }
.proptable td.v { font-family: var(--font-mono); color: #23303a; }
.proptable td.k { color: #5d676f; width: 42%; }

/* numeric validation dialog */
.numeric-dialog .dlgbody { padding: 0; }
.numhead { padding: 8px 10px; background: #f6f8f9; border-bottom: 1px solid #e2e6e9; font-size: 11.5px; color: #3d464e; }
.numhead .sub { color: #6b747c; font-size: 11px; margin-top: 2px; }
table.bench { width: 100%; border-collapse: collapse; font-size: 11px; }
table.bench th { background: #eef1f3; color: #4a545d; font-weight: 500; padding: 4px 6px; border-bottom: 1px solid #d5dade; position: sticky; top: 0; }
table.bench td { padding: 3px 6px; border-bottom: 1px solid #f0f2f4; color: #25303a; }
table.bench td.mono { font-family: var(--font-mono); font-size: 10.5px; }
table.bench th.num, table.bench td.num { text-align: right; }
.verdict-PASS { color: #1f7a3a; font-weight: 600; }
.verdict-FAIL { color: #b42f22; font-weight: 600; }
.numsum { padding: 7px 10px; background: #eef7ef; border-top: 1px solid #cfe4d3; font: 500 11.5px var(--font-ui); color: #1f6b34; display: flex; gap: 10px; align-items: center; }
.numsum.fail { background: #fbeeec; border-color: #e9c7c2; color: #91291d; }
.numnote { padding: 6px 10px 10px; font-size: 10.5px; color: #6b747c; line-height: 1.5; }
.numprog { padding: 10px; font-size: 11.5px; color: #3d464e; }
.numprog .bar { height: 5px; background: #e2e6e9; border-radius: 3px; margin-top: 7px; overflow: hidden; }
.numprog .bar i { display: block; height: 100%; width: 0; background: #4a8fc7; transition: width .15s linear; }
.mono { font-family: var(--font-mono); }
