body {
    grid-template-columns: minmax(42rem, 1fr) minmax(74rem, 1fr) 4rem; /* 4rem to have the mat filter */
}


/* -----------------------------
-------------------------------- 
 
MAIN / OVERVIEW 
 
--------------------------------
----------------------------- */

main::-webkit-scrollbar {
    display: none;
}

main {
    display: grid;
    grid-template-columns: 1fr 3rem;
    grid-auto-rows: 2rem;
    -webkit-column-gap: 0.5rem;
    -moz-column-gap: 0.5rem;
    column-gap: 0.5rem;
    row-gap: var(--grid-gap);
    box-sizing: border-box;
    background-color: #000;
}

main h2 {
    margin-left: 0.5rem;
}

main > input {
    background-color: var(--ui-2);
}

main small { color: var(--ui-3); }

main .strategies {
    grid-column: 1/-1;
}

main .strategy {
    display: grid;
    grid-template-columns: 1fr 4rem 7rem var(--toggle-w);
    -webkit-column-gap: 0.5rem;
    -moz-column-gap: 0.5rem;
    column-gap: 0.5rem;
    border-radius: var(--block-radius) 2rem 2rem var(--block-radius);
    padding: 0 0 0 0.5rem;
    cursor: pointer;
    max-height: 2rem;
    overflow-y: hidden;
    align-items: center;
    box-sizing: content-box;
    transition-property: all;
	transition-duration: 0.75s;
	transition-timing-function: var(--cb)
}

main .strategy:hover {
    background-color: var(--ui-1);
}

main .strategy > *:not(button) {
    line-height: 2rem;
}

main .strategy time {
    text-align: right;
    padding-right: 0.5rem;
}

main .strategy time,
main .strategy small {
    font-family: "JetBrains Mono";
    font-size: 0.75rem;
    color: var(--ui-5);
}

main .strategy small {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

main .strategy .kind {
    text-transform: capitalize;
    color: var(--ui-3);
}

main .strategy .name {
    font-family: "JetBrains Mono";
    color: var(--ui-4);
    transition: 0.3s color ease;
    cursor: pointer;
}


.button-edit-strategy.link {
    height: auto;
}


/* CHECKED STRATEGY USING CSS HAS MAGIC */

main .strategy:has(input:checked) .name { color: var(--ui-yellow); }


/* LOADING / SAVING / ARCHIVING STRATEGY ETC */

main.loading .strategy:not(.loading) { 
    pointer-events: none !important;
    opacity: 0.3;
}

main .strategy.loading {
    pointer-events: none !important;
    background: linear-gradient(90deg, var(--ui-2), var(--ui-2), var(--ui-3), var(--ui-2), var(--ui-2));
    -webkit-animation: loadingBGWipe 0.5s linear infinite;
    animation: loadingBGWipe 0.5s linear infinite;
    background-size: 200% 200%;
}

/* -----------------------------
-------------------------------- 
 
EDITOR 
 
--------------------------------
----------------------------- */

section#editor::-webkit-scrollbar {
    display: none;
}

/* this forces the width of the editor to take up the max amount of space */
section#editor h2 {
    text-align: right;
    margin-bottom: 0.5rem;
}

section#editor {
    -webkit-columns: 2;
    -moz-columns: 2;
    columns: 2;
    -webkit-column-gap: 2rem;
    -moz-column-gap: 2rem;
    column-gap: 2rem;
    -webkit-column-rule: 2px solid var(--ui-2);
    -moz-column-rule: 2px solid var(--ui-2);
    column-rule: 2px solid var(--ui-2);
    box-sizing: border-box;
    border-left: 1px solid var(--ui-2);
    border-right: 1px solid var(--ui-2);

    overflow-y: auto; 
    padding: 1rem; 
}

section#editor > div > *          { grid-column: span 1; }
section#editor > div > *.full     { grid-column: 1/-1; }

section#editor > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: -webkit-fit-content;
    grid-auto-rows: fit-content;
    -webkit-column-gap: 0.5rem;
    -moz-column-gap: 0.5rem;
    column-gap: 0.5rem;
    row-gap: 0.5rem;
    -webkit-column-break-inside: avoid;
    -moz-column-break-inside: avoid;
    break-inside: avoid;
}

section#editor small { line-height: 2rem; }

section#editor hr {
    height: 0;
    opacity: 0.1;
    margin: calc(1rem - 0.5px) 0;
}

section#editor > div > input.toggle {
    margin: 0.45rem 0;
}

section#editor > div > *.right {
    margin-left: auto !important;
    margin-right: 0 !important;
    display: block;
}

section#editor > div > input {
    margin-bottom: 0;
}


main.loading ~ section#editor > div > *:not(button.save) {
    opacity: 0.35;
    pointer-events: none !important;
}

main.loading ~ section#editor > div > button.save {
    pointer-events: none !important;
    background: linear-gradient(90deg, var(--ui-dark-green), var(--ui-dark-green), var(--ui-dark-green-hov), var(--ui-dark-green), var(--ui-dark-green));
    -webkit-animation: loadingBGWipe 0.5s linear infinite;
    animation: loadingBGWipe 0.5s linear infinite;
    background-size: 200% 200%;
}

body:has(#symbol-selector-stock[for^='editor']) section#editor button.save {
    opacity: 0.35;
    pointer-events: none !important;
}

#editor[executed^="1"] button.save {
    opacity: 0.35;
    pointer-events: none !important;
}

#editor[executed^="1"] #editor-strategy-name {
    text-decoration: line-through;
    color: var(--ui-green);
}

#editor[executed^="1"] #editor-strategy-name::after {
    content: " (Executed)";
}

/* so to show editor / mat-filter, and enable this state, all you need to do is add .editor class to body */
/* the entire layout will adjust automatically to fit / expand etc */

/* editor */
#editor:not([strategy]) { 
    display: none; 
}

body:has(#editor[strategy]) #button-new-strategy { 
    opacity: 0.35 !important; 
    pointer-events: none !important; 
}

body:has(#editor[strategy]) .strategy .button-edit-strategy { 
    opacity: 0.25 !important; 
    pointer-events: none !important; 
}

/* mat filter */
#editor[strategy]:has(#mat-filter-toggle:checked) ~ #mat-filter {  
    min-width: 4rem; 
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

input[field="symbol"] { text-transform: uppercase; }



/* -----------------------------
-------------------------------- 
 
search 
 
--------------------------------
----------------------------- */

body:has(#filter-strategies-input:not(:-moz-placeholder-shown)) .strategies > .strategy.filtered-out {
    opacity: 0 !important;
    pointer-events: none !important;
    max-height: 0 !important;
}

body:has(#filter-strategies-input:not(:placeholder-shown)) .strategies > .strategy.filtered-out {
    opacity: 0 !important;
    pointer-events: none !important;
    max-height: 0 !important;
}

#filter-strategies-input:not(:-moz-placeholder-shown) + #button-new-strategy {
    opacity: 0.25 !important;
    pointer-events: none !important;
}

#filter-strategies-input:not(:placeholder-shown) + #button-new-strategy {
    opacity: 0.25 !important;
    pointer-events: none !important;
}