@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
* {
	padding: 0px;
	margin: 0px;
	box-sizing: border-box;
}

html,body{
	width: 100vw;
    box-sizing: border-box;
 
}

.bar{
    background-color: yellow;
    display: block;
    position: relative;
    top: 100px;
    left: 0px;
    height: 30px;
}

.foo{
    background-color: white;
    display: block;
}

.easy{
    background-color: cyan;
    display: block;
    position: relative;
    top: 100px;
    /* left: 70px; */
    left: 0px;
    height: 30px;
}

.fox{
    background-color: cyan;
    display: block;
    position: relative;
    top: 100px;
    left: 270px;
    height: 30px;
}

.diamond{
    width: 0;
    height: 0;
    border: 110px solid transparent;
    border-bottom: 65px solid gainsboro;
    position: relative;
    top: -25px;
}

.diamond:after {
	content: '';
    position: absolute;
    left: -110px;
    top: 65px;
    width: 0;
    height: 0;
    border: 110px solid transparent;
    border-top: 66px solid gainsboro;
}

.line{
    height: 150px;
    width: 180px;
    border-bottom: solid 1px gainsboro;
}

.process{
    position: relative;
    height: 140px;
    top: 80px;
    width: 220px;
    display: inline-block;
    border: solid 1px gainsboro;
    border-radius: 5px;
    /* background-color: white; */
}

.process:hover{
    background-color: aquamarine;
}

a{
    position: relative;
    text-decoration-line: none;
}

.modal{
    /* position: relative; */
    position: absolute;
    top: 110px;
}

.url{
    width: 100%;
    height: 50px;
    font-size: 16px;
}


.filename{
    width: 100%;
    height: 50px;
    font-size: 16px;
}

.none{
    visibility: hidden;
}

.ifel{
    content: '';
    position: absolute;
    top: -105px;
    /* left: 422px; */
    border-left: 1px solid gainsboro;
    border-bottom: 1px solid gainsboro;
    width: 215px;
    height: 255px;
}

.ifthen{
    content: '';
    position: relative;
    top: -110px;
    /* left: 90px; */
    border-left: 1px solid gainsboro;
    border-bottom: 1px solid gainsboro;
    width: 0px;
    height: 200px;
}

.endifel{
    width: 0px;
}
.endifel div.rect{
    position: absolute;
    top: 155px;
    border-left: 1px solid gainsboro;
    width: 185px;
    height: 313px;
}

.endflow-label {
    position: absolute;
    top: 175px;
    left: 0;
    width: 110px;
    font-size: 11px;
    border: none;
    background: transparent;
    text-align: center;
    outline: none;
    color: #555;
    padding: 2px 4px;
    box-sizing: border-box;
}

.endflow{
    z-index: 2;
    position: relative;
    top: 125px;
    width: 50px !important;
    height: 50px !important;
    background: white;
    border-radius: 50%;
    border: solid 3px #aaa;
}

.endflow div.arrow{
    top: 12px !important;
    width: 0px !important;
}

.circle{
    border-radius: 50%;
    width: 10px;
    position: relative;
    background-color: gainsboro;
    height: 10px;
    top: 145px;
    right: 4px;
    z-index: 2;
}

.arrow{
    width: 0;
    position: absolute;
    height: 0;
    top: 140px;
    margin-left: -10px;
    border-top: 10px solid transparent;
    border-left: 15px solid gainsboro;
    border-bottom: 10px solid transparent;
}

.arrow-down{
    content: '';
    position: absolute;
    left: 100px;
    top: 65px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-top: 15px solid gainsboro;
}

ul{
    display: flex;
    list-style: none;
}

ul#main{
    display: block;
    padding: 20px;
    position: relative;
}

li{
    top: 25px;
    width: 220px;
    height: 320px;
    text-align: center;
    position: relative;
}

li.half {
    width: 110px;
    text-align: center;
}

li.half div.endflow {
    width: 110px;
    text-align: center;
}

.invisible{
    visibility: hidden;
}

.branch{
    display: flex;
}

.ui button{
    width: 150px;
    height: 50px;
}

.d-body{
    position: absolute;
    right: -73px;
    top: 20px;
    z-index: 1;
    width: 150px;
    height: 90px;
}

.abs{
    position:absolute;
}

.y{
    position: absolute;
    right: -32px;
    top: 116px;
}

.n{
    position: absolute;
    right: 65px;
    bottom: 75px;
}

/* --- file/document node --- */
.proc-file {
    position: relative;
    top: 80px;
    width: 220px;
    height: 140px;
    background: white;
    border: 1px solid #888;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 28px 8px 8px;
    word-break: break-word;
    font-size: 13px;
}
.proc-file::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(225deg, #ddd 50%, white 50%);
    border-left: 1px solid #888;
    border-bottom: 1px solid #888;
}
.proc-file-label {
    display: block;
    width: 100%;
    text-align: center;
    pointer-events: none;
}
[data-mode="connect"] .proc-file:hover .conn-dot { opacity: 1; transform: scale(1.4); }
[data-mode="connect"] .proc-file .conn-dot        { opacity: 0.4; }
.proc-file:hover .conn-dot                        { opacity: 1; }

/* --- database/cylinder node --- */
.proc-db {
    position: relative;
    top: 110px;
    width: 180px;
    height: 80px;
    background: #e8f4ff;
    border-left: 1px solid #6ab0ff;
    border-right: 1px solid #6ab0ff;
    border-bottom: 1px solid #6ab0ff;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4px 8px;
    margin: 0 auto;
}
.proc-db::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -1px;
    right: -1px;
    height: 40px;
    background: #bdd9ff;
    border: 1px solid #6ab0ff;
    border-radius: 50%;
    z-index: 1;
}
.proc-db::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -1px;
    right: -1px;
    height: 40px;
    background: #e8f4ff;
    border: 1px solid #6ab0ff;
    border-radius: 50%;
}
.proc-db-label {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    pointer-events: none;
}
[data-mode="connect"] .proc-db:hover .conn-dot { opacity: 1; transform: scale(1.4); }
[data-mode="connect"] .proc-db .conn-dot        { opacity: 0.4; }
.proc-db:hover .conn-dot                        { opacity: 1; }

/* --- process+link node --- */
.proc-doc {
    position: relative;
    top: 80px;
    width: 220px;
    height: 140px;
    display: flex;
    flex-direction: column;
    border: 1px solid #4a9eff;
    border-radius: 5px;
    overflow: hidden;
    box-sizing: border-box;
}
.proc-doc-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    text-align: center;
}
.proc-doc-url {
    border: none;
    border-top: 1px solid #c0d8ff;
    background: #f0f6ff;
    padding: 5px 8px;
    font-size: 11px;
    width: 100%;
    outline: none;
    box-sizing: border-box;
    color: #333;
}
.proc-doc-url:focus { background: #e6f0ff; }
[data-mode="connect"] .proc-doc:hover .conn-dot { opacity: 1; transform: scale(1.4); }
[data-mode="connect"] .proc-doc .conn-dot        { opacity: 0.4; }
.proc-doc:hover .conn-dot                        { opacity: 1; }

/* --- toolbar --- */
.toolbar {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1000;
    display: flex;
    gap: 6px;
}

.tool-btn {
    padding: 6px 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 13px;
}

.tool-btn.active {
    background: #4a9eff;
    color: white;
    border-color: #4a9eff;
}

/* hide dots in move mode */
[data-mode="move"] .conn-dot {
    display: none !important;
}

/* show all dots at once in connect mode */
[data-mode="connect"] .conn-dot {
    opacity: 0.4;
}

[data-mode="connect"] p.process:hover .conn-dot,
[data-mode="connect"] li.d:hover .conn-dot,
[data-mode="connect"] .endflow:hover .conn-dot {
    opacity: 1;
    transform: scale(1.4);
}

/* --- connection dots --- */
.conn-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #4a9eff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
    cursor: crosshair;
    z-index: 100;
    pointer-events: all;
}

p.process:hover .conn-dot,
li.d:hover .conn-dot,
.endflow:hover .conn-dot {
    opacity: 1;
}

.conn-dot.conn-active {
    opacity: 1 !important;
    background: #ff6b35;
    box-shadow: 0 0 6px rgba(255, 107, 53, 0.6);
}

.conn-dot-top    { top: -4px;    left: calc(50% - 4px); }
.conn-dot-bottom { bottom: -4px; left: calc(50% - 4px); }
.conn-dot-left   { left: -4px;   top: calc(50% - 4px); }
.conn-dot-right  { right: -4px;  top: calc(50% - 4px); }

/* align dots to the actual visual diamond corners */
li.d .conn-dot-top    { top: 81px;  bottom: auto; }
li.d .conn-dot-bottom { top: 212px; bottom: auto; }
li.d .conn-dot-left   { top: 146px; }
li.d .conn-dot-right  { top: 146px; }

/* if2: yes=bottom, no=right — swap y/n label positions + distinct color */
li.d.if2 .y { right: 65px;  top: auto; bottom: 75px; }
li.d.if2 .n { right: -32px; bottom: auto; top: 116px; }
li.d.if2 .diamond          { border-bottom-color: #a8d0ff; }
li.d.if2 .diamond::after   { border-top-color: #a8d0ff; }