:root {
    --pageSizeW: 100%;
    --pageSizeH: 100%;
    --cActiveWell: #008000;
    --cEffective: #00ff00;
    --cActiveCritical: #ff8000;
    --cFailed: #ff0000;
    --cUndetermined: #ffff00;
    --cPlanned: #0000ff;
    --gridColCount: 0;
    --gridAgentRowCount: 0;
    --xWidth: 20px;
    --yHeight: 20px;
}

[data-theme="green"] {
    --tools-bgcolor: #030303;
    --main-bgcolor: #0f140f;
    --c1l: #54ae0a;
    --c1d: #0f2b01;
    --c2l: #f3bf31;
    --c2d: #554a18;
    --c3l: #4a9f58;
    --c3d: #1c2c1f;
    --c4: #e1e1e1;
    --cNight: #00000080;
}

[data-theme="blue"] {
    --tools-bgcolor: #1f1f1f;;
    --main-bgcolor: #2c2c2c;
    --c1l: #96c5e6;
    --c1d: #407097;
    --c2l: #ce3500;
    --c2d: #380e00;
    --c3l: #80a7c4;;
    --c3d: #335877;
    --c4: #e1e1e1;
    --cNight: #00000080;
}

[data-theme="white"] {
    --tools-bgcolor: #c8c8c8;
    --main-bgcolor: #ffffff;
    --c1l: #000000;
    --c1d: #808080;
    --c2l: #000000;
    --c2d: #808080;
    --c3l: #000000;
    --c3d: #808080;
    --c4: #000000;
    --cNight: #91919180;
}

[data-theme="black"] {
    --tools-bgcolor: #030303;
    --main-bgcolor: #141414;
    --c1l: #808080;
    --c1d: #141414;
    --c2l: #808080;
    --c2d: #000000;
    --c3l: #808080;
    --c3d: #141414;
    --c4: #808080;
    --cNight: #00000080;
}


html {
    height: 100%;
    margin: 0;
}

body {
    margin: 0;
    width: var(--pageSizeW);
    height: var(--pageSizeH);
    background-color: var(--main-bgcolor);
    font-family: monospace;
}

.cursor {
    width: 10px;
    height: 10px;
    background-color: #f39c12;
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transition: transform 0.1s ease-out;
    z-index: 100;
}

input[type=datetime-local]:invalid {
    color: red;
    border-color: red;
}

input[type=checkbox] {
    appearance: none;
    background-color: var(--c2d);
    border: 1px solid var(--c2l);
    height: 1em;
    width: 1em;
    vertical-align: top;
    margin: 2px 4px 3px 4px;
}

input[type=checkbox]:checked {
    background-color: var(--c2l);
}

input[type=radio] {
    appearance: none;
    background-color: var(--c2d);
    border: 1px solid var(--c2l);
    border-radius: 100%;
    height: 1em;
    width: 1em;
    display: inline-block;
    vertical-align: middle;
    position: relative;
}

input[type=radio]:checked {
    background-color: var(--c2l);
}

input[disabled],
input[readonly],
textarea[readonly] {
    background-color: var(--tools-bgcolor);
    opacity: 0.4;
}

#gridContainer {
    scrollbar-color: var(--c1d) var(--c1d);
    position: absolute;
    top: 0;
    left: 54px;
    right: 55px;
    bottom: 0;
}

#grid {
    transform-origin: top left;
    border: 1px solid var(--c3l);
    overflow: auto;
    position: relative;
    display: grid;
    background-color: var(--main-bgcolor);
    grid-template-columns: max-content max-content repeat(var(--gridColCount), var(--xWidth));
    grid-template-rows: repeat(3, 21px) repeat(var(--gridAgentRowCount), var(--yHeight));
    color: var(--c4);
    user-select: none;
    height: 100%;
    overscroll-behavior: none;
}
#gridHeader {
    cursor: move;
    display: contents;
}
#head1 {
    display: contents;
}
.header1 {
    top: 0px;
}
.header2 {
    top: 20px;
}
.header3 {
    top: 40px;
}
.grid2cell {
    background-color: var(--main-bgcolor);
    height: var(--yHeight);
    outline: 1px solid var(--c3l);
}
.gridCol {
    grid-column-end: span 1;
    grid-row-start: 4;
    grid-row-end: -1;
    /*outline: 1px solid var(--c3l);*/
    border-left: 1px solid var(--c3l);
    z-index: 2;
}
.gridRow {
    grid-column-start: 1;
    grid-column-end: -1;
    grid-row-end: span 1;
    /*outline: 1px solid var(--c3l);*/
    border-bottom: 1px solid var(--c3l);
}
.grid2topheadercell {
    background-color: var(--main-bgcolor);
    border-left: 1px solid var(--c3l);
    border-bottom: 1px solid var(--c3l);
    height: 20px;
    position: sticky;
    z-index: 30;
    white-space: nowrap;
    text-align: center;
    align-content: center;
    overflow: hidden;
}

.grid2topheaderleftcell {
    background-color: var(--main-bgcolor);
    border-right: 1px solid var(--c3l);
    border-bottom: 1px solid var(--c3l);
    position: sticky;
    top: -1px;
    left: -1px;
    height: 62px;
    z-index: 50;
    white-space: nowrap;
    text-align: center;
    align-content: center;
    cursor: pointer;
}

.grid2unassignedheadercell {
    height: calc(var(--yHeight) - 1px);
    border-right: 1px solid var(--c3l);
    border-bottom: 1px solid var(--c3l);
    position: sticky;
    left: -1px;
    z-index: 40;
    white-space: nowrap;
    text-align: center;
    align-content: center;
    overflow: hidden;
}
.grid2groupheadercell {
    height: calc(100% - 1px);
    width: 21px;
    position: sticky;
    left: -1px;
    z-index: 45;
    white-space: nowrap;
    text-align: center;
    align-content: center;
    overflow: hidden;
    writing-mode: sideways-lr;
    border-right: 1px solid var(--c3l);
    border-bottom: 1px solid var(--c3l);
    cursor: pointer;
}
.grid2agentheadercell {
    height: calc(var(--yHeight) - 1px);
    width: calc(100% - 1px);
    position: sticky;
    left: 21px;
    z-index: 40;
    white-space: nowrap;
    text-align: center;
    align-content: center;
    overflow: hidden;
    border-right: 1px solid var(--c3l);
    border-bottom: 1px solid var(--c3l);
    cursor: pointer;
}
.night {
    background-color: var(--cNight);
}

button {
    text-transform: uppercase;
}

li[draggable="true"] {
    cursor: grab;
}

.draggedSrcElement {
    opacity: 0.5;
}

#toolbar {
    visibility: hidden;
    width: 54px;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    text-align: center;
    background-color: var(--tools-bgcolor);
}

#toolbar button {
    font-family: monospace;
    width: 36px;
    height: 36px;
    margin: 8px;
    padding: 0;
    color: var(--c1l);
    background-color: var(--c1d);
    border-color: var(--c1l);
    border-style: solid;
    border-width: 2px;
    border-radius: 2px;
    cursor: pointer;
}

#toolbar button:active {
    color: var(--c2l);
    border-color: var(--c2l);
    background-color: var(--c2d);
}

#toolbar hr {
    margin: 0;
    border-top: 1px solid var(--c3l);
    border-bottom: none;
}


#toolbar2 {
    visibility: hidden;
    width: 54px;
    height: 100%;
    position: fixed;
    top: 0;
    right: 0;
    text-align: center;
    background-color: var(--tools-bgcolor);
}

#toolbar2 button {
    font-family: monospace;
    width: 36px;
    height: 36px;
    margin: 8px;
    padding: 0;
    color: var(--c1l);
    background-color: var(--c1d);
    border-color: var(--c1l);
    border-style: solid;
    border-width: 2px;
    border-radius: 2px;
    cursor: pointer;
}

#toolbar2 button[title=""] {
    opacity: 0.5;
}

#toolbar2 button.active,
#toolbar2 button:active {
    color: var(--c2l);
    border-color: var(--c2l);
    background-color: var(--c2d);
}

#toolbar2 hr {
    margin: 0;
    border-top: 1px solid var(--c3l);
    border-bottom: none;
}

#statusDisplay {
    visibility: hidden;
    position: absolute;
    bottom: 0;
    left: 54px;
    right: 54px;
}

#statusDisplay table {
    border: none;
    border-collapse: collapse;
    width: 100%;
}
#statusDisplay thead {
    border-collapse: collapse;
    border: none;
    position: relative;
}
#statusDisplay th,
#statusDisplay td {
    cursor: auto;
    position: relative;
    border-collapse: collapse;
    color: var(--c3l);
    border: 1px solid var(--c3l);
    height: 20px;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    background: var(--main-bgcolor);
}

.vcenter {
    position: relative;
    top: 40%;
    transform: translateY(-40%);
}

dialog {
    font-family: monospace;
    text-align: left;
    width: 66%;
    background-color: var(--tools-bgcolor);
    color: var(--c4);
}

dialog::backdrop {
    background: rgba(10,10,10,.75);
}

dialog form {
    display: flex;
    flex-wrap: wrap;
}

dialog button {
    width: min(100px);
    height: 30px;
    margin: 8px 8px 8px 0;
    padding: 0;
    background-color: var(--c2d);
    border-color: var(--c2l);
    color: var(--c2l);
    border-style: solid;
    border-width: 1px;
    border-radius: 3px;
    cursor: pointer;
}

dialog button[value="cancel"] {
    background-color: var(--tools-bgcolor);
}

dialog button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

dialog fieldset {
    width: calc(100% - 26px);
    flex: content;
    overflow: auto;
    margin-right: 6px;
    border: 1px solid var(--c3d);
    margin-top: 6px;
}

.cropped fieldset {
    max-height: 150px;
}

dialog fieldset:has(legend) {
    margin-top: 0;
}

dialog fieldset:last-of-type {
    flex-basis: 100%;
}

dialog select {
    font-family: monospace;
    background-color: var(--c2d);
    border: 1px solid var(--c2l);
    color: var(--c2l);
    margin: 3px;
}

dialog input,
dialog textarea {
    font-family: monospace;
    background-color: var(--c2d);
    color: var(--c2l);
    border: 1px solid var(--c2l);
    margin: 3px;
    width: 170px;
}

dialog textarea {
    width: 20em;
    height: 14em;
}

dialog ol,
dialog ul {
    list-style: none;
    padding-inline: 0;
}

dialog .name {
    color: var(--c1l);
    border: 1px solid var(--c1l);
    display: inline-block;
    width: 400px;
}

dialog .inner .name {
    color: var(--c1l);
    border: 1px solid var(--c1l);
    display: inline-block;
    width: 384px;
}

dialog ol .inner {
    margin-left: 16px;
}

dialog li {
    padding: 12px 0 0 0;
    margin: 0;
}

dialog li label {
    color: var(--c1l);
}

dialog .inner li {
    padding: 4px 0 0 0;
    margin: 0;
}

details ul {
    padding: 0;
    margin: 0;
}

details li {
    padding: 0;
    margin: 0;
}

dialog ol button,
dialog ul button {
    background-color: var(--c1d);
    color: var(--c1l);
    width: auto;
    min-width: 6em;
    height: auto;
    border: 1px solid var(--c1l);
    border-radius: 3px;
    margin: 0 0 0 4px;
    cursor: pointer;
}

dialog ol button[value="delete"] {
    background-color: var(--tools-bgcolor);
    border-color: var(--c1l);
    color: var(--c1l);
    border-style: solid;
    border-width: 1px;
    border-radius: 3px;
    cursor: pointer;
}

#pcFormSignalingResponse {
    margin: 8px;
    width: 500px;
}

#pcDialogTable {
    border: none;
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}
#pcDialogTable thead {
    border: none;
}
#pcDialogTable th,
#pcDialogTable td {
    cursor: auto;
    color: var(--c3l);
    border: 1px solid var(--c3l);
    height: 20px;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    background: var(--main-bgcolor);
}

#pcDialogTable td button {
    background-color: var(--c1d);
    color: var(--c1l);
    width: auto;
    height: auto;
    border: 1px solid var(--c1l);
    border-radius: 3px;
    margin: 0 0 0 4px;
    cursor: pointer;
}

#editTask_reference label {
    border-width: 1px;
    line-height: 2em;
}

#gotoMarker {
    height: 20px;
    width: var(--xWidth);
    bottom: -12px;
    left: -2px;
    position: absolute;
    z-index: 36;
    font-size: xx-small;
}
#gotoMarker::after {
    content: "▼";
    left: -2px;
    bottom: 0px;
    font-family: monospace;
    color: var(--c2l);
}

#centerMarker {
    height: 20px;
    width: var(--xWidth);
    bottom: -12px;
    left: -2px;
    position: absolute;
    z-index: 36;
    font-size: xx-small;
}
#centerMarker::after {
    content: "▲";
    left: -2px;
    bottom: 0px;
    font-family: monospace;
    color: var(--c2l);
}

#cdtMarker {
    height: 100%;
    width: 0;
    border-style: dashed;
    border-color: var(--c2l);
    border-width: 0 0 0 1px;
    margin-top: 2px;
    position: absolute;
    z-index: 34;
}
#cdtMarker::after {
    content: "CDT";
    position: sticky;
    top: 0;
    font-family: monospace;
    border: 1px solid var(--c2l);
    color: var(--c2l);
    background-color: var(--c2d);
}

#nowMarker {
    height: 100%;
    width: 0;
    border-style: dashed;
    border-color: var(--c2l);
    border-width: 0 0 0 1px;
    margin-top: 2px;
    top: 0;
    position: absolute;
    z-index: 35;
}
#nowMarker::after {
    content: "NOW";
    position: sticky;
    top: 0;
    font-family: monospace;
    border: 1px solid var(--c2l);
    color: var(--c2l);
    background-color: var(--c2d);
}

#taskContainer {
    display: grid;
}

task-point {
    position: absolute;
}

task-div {
    position: absolute;
}

point-detail {
    position: fixed; 
    width: fit-content;
    max-width: 40em;
    min-width: 10em;
    height: fit-content;
    z-index: 10;
}

task-detail {
    position: fixed; 
    width: fit-content;
    max-width: 40em;
    min-width: 10em;
    height: fit-content;
    z-index: 10;
}

.connector {
    position: absolute;
    width: 2px;
    z-index: 3;
}

.generic {
    border: 1px solid transparent;
    background-color: transparent;
}

.planned {
    border: 1px dotted black;
    background-color: var(--cPlanned);
    color: black;
}

.activeWell {
    border: 1px solid black;
    background-color: var(--cActiveWell);
    color: black;
}

.activeCritical {
    border: 1px solid black;
    background-color: var(--cActiveCritical);
    color: black;
}

.failed {
    border: 1px solid black;
    background-color: var(--cFailed);
    color: black;
}

.undetermined {
    border: 1px solid black;
    background-color: var(--cUndetermined);
    color: black;
}

.effective {
    border: 1px solid black;
    background-color: var(--cEffective);
    color: black;
}

.taskRel {
    border-style: dotted;
}

.taskCDT {
    border-style: dashed;
}

.taskAbs {
    border-style: solid;
}

@page {
    orientation: landscape;
    size: var(--pageSizeW) var(--pageSizeH);
    margin: 5mm;
}

@media print {
    #toolbar,
    #toolbar1 {
        display: none;
    }

    body {
        width: var(--pageSizeW);
    }

    #gridContainer {
        left: 0;
        right: 0;
        width: var(--pageSizeW);
    }
}
