/* Aufzugsteuerung – JavaScript-Port (2026). Java Swing, Metal Look and Feel ("Ocean", Java 5). */
:root {
  --bg: #eeeeee;
  --dark: #7a8a99;      /* secondary1 */
  --sec2: #b8cfe5;      /* secondary2 */
  --p1: #6382bf;        /* primary1 */
  --p2: #a3b8cc;        /* primary2 */
  --p3: #b8cfe5;        /* primary3 */
  --g1: #dde8f3;
  --sel: #c8ddf2;       /* TabbedPane.selected */
  --text: #333333;
  --etch-d: #a6a6a6;
  --font: "Dialog", "Lucida Grande", "Segoe UI", Tahoma, "DejaVu Sans", Arial, sans-serif;
  --mono: "DejaVu Sans Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #5a6f8f; overflow: hidden; }
body { font: bold 12px var(--font); color: var(--text); }
button, input, select, output { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Rahmen */
.frame {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 4px solid var(--p1);
  box-shadow: inset 0 0 0 1px var(--p3);
  min-width: 640px; min-height: 480px;
}
.titlebar {
  flex: 0 0 22px; display: flex; align-items: center; gap: 6px; padding: 0 3px 0 5px;
  background: linear-gradient(#dde8f3 0%, #ffffff 30%, #dde8f3 60%, #b8cfe5 100%);
  border-bottom: 1px solid var(--p1);
  user-select: none;
}
.ticon {
  width: 14px; height: 14px; flex: none;
  background: linear-gradient(90deg, transparent 2px, #326464 2px, #326464 6px, transparent 6px, transparent 8px, #326464 8px, #326464 12px, transparent 12px),
              linear-gradient(#999, #999);
  background-size: 14px 10px, 14px 14px; background-position: 0 4px, 0 0; background-repeat: no-repeat;
  border: 1px solid #320000;
}
.ttext { white-space: nowrap; color: #000; }
.bumps {
  flex: 1; height: 12px; margin: 0 6px;
  background-image: radial-gradient(circle at 1px 1px, #ffffff 0.8px, transparent 1px),
                    radial-gradient(circle at 1px 1px, #6382bf 0.8px, transparent 1px);
  background-size: 4px 4px; background-position: 0 0, 1px 1px;
}
.tbtns { display: flex; gap: 2px; }
.tbtn {
  width: 16px; height: 16px; padding: 0; border: 1px solid var(--dark);
  background: linear-gradient(#ffffff, #dde8f3 60%, #b8cfe5); position: relative; cursor: default;
}
.tbtn::after { content: ""; position: absolute; left: 3px; right: 3px; bottom: 3px; height: 2px; background: #333; }
.tb-max::after { top: 3px; bottom: 3px; height: auto; background: transparent; border: 1px solid #333; border-top-width: 2px; }
.tb-close::after { content: "\00d7"; background: none; inset: -2px 0 0 0; height: auto; font: bold 14px/16px var(--font); text-align: center; color: #333; }
.tb-close { cursor: pointer; }

/* ---------------------------------------------------------------- Menüs */
.menubar {
  flex: 0 0 22px; display: flex; align-items: stretch; padding-left: 2px;
  background: linear-gradient(#ffffff, #eeeeee 70%, #e3e3e3);
  border-bottom: 1px solid #c8c8c8; position: relative; z-index: 10;
}
.menu { position: relative; }
.mtitle {
  height: 100%; border: 1px solid transparent; background: none; padding: 0 9px; cursor: default;
}
.menu.open > .mtitle, .mtitle:hover { background: var(--p2); border-color: var(--dark); }
.mpopup {
  display: none; position: absolute; left: 0; top: 100%; min-width: 240px;
  background: #ffffff; border: 1px solid var(--dark); padding: 1px 0;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .18);
}
.menu.open > .mpopup { display: block; }
.mpopup button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 3px 14px 3px 22px; cursor: default; white-space: nowrap;
}
.mpopup button:hover:not(:disabled), .mpopup button:focus-visible { background: var(--p2); outline: none; }
.mpopup button:disabled { color: #a0a0a0; }
.mpopup hr { border: 0; border-top: 1px solid var(--etch-d); border-bottom: 1px solid #fff; margin: 2px 1px; }

/* ---------------------------------------------------------------- Tabs */
.tabbed { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; padding: 4px 4px 0; }
.tabstrip { flex: 0 0 auto; display: flex; padding-left: 2px; position: relative; z-index: 1; }
.tab {
  margin-right: -1px; padding: 3px 12px 3px; border: 1px solid var(--dark); border-bottom: 0;
  background: linear-gradient(#ffffff, #dde8f3 70%, #ccdcea); cursor: default;
  border-radius: 0; height: 22px; margin-top: 2px;
}
.tab:first-child { clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%, 0 6px); }
.tab.sel { background: var(--sel); height: 24px; margin-top: 0; margin-bottom: -1px; position: relative; }
.tab:focus-visible { outline: 1px dotted #333; outline-offset: -4px; }
.tabbody {
  flex: 1 1 auto; min-height: 0; border: 1px solid var(--dark); border-top: 3px solid var(--sel);
  background: var(--bg); display: flex;
}
.tabpanel { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; gap: 5px; padding: 4px; }
.cvwrap { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; }
.cvwrap canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
#wrap-slider { flex: 0 0 auto; }
.etched { border: 1px solid var(--etch-d); box-shadow: 1px 1px 0 #fff, inset 1px 1px 0 #fff; }
.textarea {
  flex: 1 1 0; min-width: 200px; margin: 5px; padding: 3px 5px; overflow: auto;
  background: #f0f0f0; border: 1px solid var(--dark); color: #000;
  font: normal 11px/1.3 var(--mono); tab-size: 3; -moz-tab-size: 3; white-space: pre;
}

/* Statistik-Tab: GridBagLayout mit 4 Spalten */
#tab-statistik { align-items: center; justify-content: center; overflow: auto; }
.statgrid {
  display: grid; grid-template-columns: auto 120px auto 120px; gap: 5px 8px; align-items: center;
}
.statgrid label { text-align: right; }
.statgrid input { width: 120px; }

/* ---------------------------------------------------------------- Steuerleiste */
.controls {
  flex: 0 0 34px; display: flex; align-items: center; gap: 4px; padding: 0 5px; margin: 4px 4px 0;
  border: 1px solid var(--etch-d); box-shadow: 1px 1px 0 #fff, inset 1px 1px 0 #fff;
  white-space: nowrap; overflow: hidden;
}
.controls .sep { width: 1px; height: 20px; border-left: 1px solid var(--etch-d); border-right: 1px solid #fff; margin: 0 2px; }
#c-zeit { font-family: var(--mono); font-weight: normal; margin-left: auto; padding: 1px 4px; border: 1px solid var(--dark); background: #fff; }
#c-speedtxt { display: inline-block; min-width: 38px; text-align: center; padding: 1px 2px; border: 1px solid var(--dark); background: #fff; font-weight: normal; }

.btn {
  height: 23px; padding: 0 7px; border: 1px solid var(--dark); border-radius: 0;
  background: linear-gradient(#dde8f3 0%, #ffffff 30%, #dde8f3 60%, #b8cfe5 100%);
  box-shadow: inset 1px 1px 0 #fff; cursor: default; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--p1); }
.btn:active:not(:disabled), .btn.on { background: linear-gradient(#b8cfe5, #a3b8cc); box-shadow: none; }
.btn:disabled { color: #a0a0a0; background: var(--bg); border-color: #c0c0c0; }
.btn:focus-visible, select:focus-visible, input:focus-visible { outline: 1px solid var(--p2); outline-offset: 1px; }

input[type=number], input[readonly], input[type=text], select {
  height: 21px; border: 1px solid var(--dark); background: #fff; padding: 0 3px; font-weight: normal;
  border-radius: 0;
}
select { background: linear-gradient(#ffffff, #dde8f3); padding-right: 2px; }
input[type=number] { width: 80px; text-align: right; }
input[readonly] { color: #000; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 96px; height: 18px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 7px; background: #fff; border: 1px solid var(--dark); box-shadow: inset 0 2px 0 var(--p3); }
input[type=range]::-moz-range-track { height: 5px; background: #fff; border: 1px solid var(--dark); box-shadow: inset 0 2px 0 var(--p3); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 16px; margin-top: -6px; border: 1px solid #333366;
  background: linear-gradient(135deg, #dde8f3, #a3b8cc 50%, #6382bf);
  clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%);
}
input[type=range]::-moz-range-thumb {
  width: 13px; height: 14px; border: 1px solid #333366; border-radius: 0;
  background: linear-gradient(135deg, #dde8f3, #a3b8cc 50%, #6382bf);
  clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%);
}

.footer {
  flex: 0 0 auto; padding: 3px 8px 4px; font: normal 10.5px/1.3 var(--font); color: #333;
  border-top: 1px solid #fff; margin-top: 4px; background: linear-gradient(#e6e6e6, #dcdcdc);
}

/* ---------------------------------------------------------------- Dialoge */
.modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(40, 50, 70, .18);
}
.dialog {
  position: absolute; display: flex; flex-direction: column; max-width: calc(100% - 16px); max-height: calc(100% - 16px);
  background: var(--bg); border: 4px solid var(--p1); box-shadow: inset 0 0 0 1px var(--p3), 3px 3px 0 rgba(0, 0, 0, .25);
}
.dialog .titlebar { flex: 0 0 22px; }
.dialog .dbody { padding: 8px; overflow: auto; min-height: 0; flex: 1 1 auto; }
.dialog .dbuttons { display: flex; gap: 6px; justify-content: center; padding: 6px 8px 8px; flex: 0 0 auto; }
.dialog .dbuttons .btn { min-width: 84px; }
.panel {
  position: relative; border: 1px solid var(--etch-d); box-shadow: 1px 1px 0 #fff, inset 1px 1px 0 #fff;
  padding: 12px 8px 7px; margin: 8px 0 4px;
}
.panel > .ptitle { position: absolute; top: -8px; left: 8px; padding: 0 3px; background: var(--bg); }
.form { display: grid; grid-template-columns: auto auto auto auto; gap: 4px 8px; align-items: center; }
.form label { text-align: right; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.setup-grid .full { grid-column: 1 / -1; }
.msg { display: flex; gap: 12px; align-items: flex-start; padding: 4px 6px; max-width: 420px; font-weight: normal; }
.msg .icon {
  flex: none; width: 32px; height: 32px; border: 2px solid var(--p1); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font: bold 20px/1 var(--font); color: var(--p1); background: #fff;
}
.msg .icon.err { border-color: #c03030; color: #c03030; }
.textdlg {
  width: 100%; height: 100%; min-height: 260px; resize: none; border: 1px solid var(--dark); background: #fff;
  font: normal 11px/1.35 var(--mono); tab-size: 4; -moz-tab-size: 4; white-space: pre; padding: 4px;
}
.lesetext { font: normal 12px/1.45 var(--font); background: #fff; border: 1px solid var(--etch-d); padding: 8px 12px; color: #000; }
.lesetext h3 { font-size: 12px; margin: 10px 0 3px; }
.lesetext p, .lesetext ul { margin: 4px 0; }
.lesetext ul { padding-left: 18px; }
.lesetext .klein { font-size: 11px; color: #444; }
.beendet {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: #5a6f8f; color: #fff; font: bold 13px var(--font); z-index: 50;
}
