body2:after {
    content: '';
    position: fixed;
    top: 0px;
    left: 0px;
    height: 100vh;
    width: 100vw;
    background-image: url('../src/doc_editor_v1_main.png');
    background-size: auto calc(1400px/2);
    background-position: top left;
    background-repeat: no-repeat;
    outline: 1px solid red;
    opacity: .25;
    pointer-events: none;
    opacity: 0;
}

body:before2 {
    content: "AI Tools";
    color: white;
    display: block;
    position: fixed;
    left: 50%;
    translate: -50% 0px;
    z-index: 99999999;
    top: 20px;
    font-size: 50px;
    font-family: 'SF-Pro-Display';
    text-transform: uppercase;
    font-weight: 500;
}

@font-face {
    font-family: 'SF-Merged';
    font-style: normal;
    font-weight: 400;
    src: local('SF-Pro'), local('SF-Pro-Display');
}

[score-bracket='0'], [score='0'] {
    --bracket_color: gray;
    --bracket_bg_color: rgb(0 0 0 / 10%);
    --bracket_bg_color: rgb(205 205 205);
}

[score-bracket='1'], [score='1'], [score='􀆄'] {
    --bracket_color: red;
    --bracket_bg_color: rgb(255 0 0 / 10%);
    --bracket_bg_color: rgb(255 213 212);
}

[score-bracket='2'], [score='2'] {
    --bracket_color: orange;
    --bracket_bg_color: rgb(255 165 0 / 10%);
    --bracket_bg_color: rgb(255, 237, 214);
}

[score-bracket='3'], [score='3'], [score='􀆅'] {
    --bracket_color: limegreen;
    --bracket_bg_color: rgb(50 205 50 / 10%);
    --bracket_bg_color: rgb(220, 245, 220);
}

docs-list card:before {
    content: counter(row);
    position: absolute;
    left: 0px;
    top: 50%;
    translate: 0px -50%;
    width: 60px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: .25;
}

#contentRefiner {
    display: grid;
    grid-template-rows: auto 1fr;
    text-rendering: geometricPrecision;
    & docs-root {
        display: grid;
        height: 100%;
        box-sizing: border-box;
        margin: auto;
        grid-template-rows: 1fr;
        background: rgba(246, 246, 246);
        /* padding: 20px calc((100vw - 600px)/2); */
        padding: 20px;
        gap: 20px;
        overflow: hidden;
    }

    & docs-controls {
        height: 100px;
        display: flex;
        background: white;
        border-radius: 14px;
        align-items: center;
        justify-content: center;
        gap: 20px;
        width: fit-content;
        padding: 20px;
        box-sizing: border-box;
        & icon- {
            font-size: 40px;
            font-weight: 200;
            height: 60px;
            width: 60px;
            box-sizing: border-box;
        }
    }

    & docs-list {
        position: relative;
        display: grid;
        grid-template-rows: 25px 1fr;
        row-gap: 20px;
        overflow: hidden;
        padding: 5px;
        margin: -5px;
        & options {
            display: grid;
            grid-template-columns: 1fr auto auto;
            column-gap: 10px;
            align-items: end;
            & input {
                field-sizing: content;
                min-width: 105px;
                max-; max-width: 250px;
            }

            &:before {
                content: 'Documents';
                font-size: 24px;
                font-weight: 700;
                opacity: .6;
                line-height: 20px;
                text-indent: 20px;
            }
        }

        & cards {
            overflow: scroll;
            display: block;
            border-radius: 14px;
            background: white;
        }

        & card {
            display: grid;
            padding: 20px;
            box-sizing: border-box;
            box-shadow: 0px -21px 0px -20px rgba(0, 0, 0, .15);
            letter-spacing: .25px;
            gap: 5px;
            counter-increment: row;
            cursor: pointer;
            padding-left: 70px;
            position: relative;
            &:hover {
                background: rgba(0, 0, 0, .025);
            }
        }

        & card-title {
            font-size: 18px;
            font-weight: 600;
            display: inline-flex;
            align-self: end;
        }

        & card-info {
            display: inline-flex;
            align-self: start;
            opacity: .5;
            font-size: 12px;
        }
    }
}

#pageDocument {
    & columns {
        grid-template-columns: 1fr 343px;
    }

    & column {
        display: grid;
        grid-template-rows: minmax(50px, auto) 1fr;
        position: relative;
        overflow: hidden;
        & app-head {
            position: relative;
            box-sizing: border-box;
            row-gap: 5px;
            z-index: 9999999;
        }
    }
}

#pageDocument column:has([scrolled]) app-head {
    box-shadow: var(--header-box-shadow);
}

#docEditorMain {
    & app-head {
        padding: 20px 30px;
        display: grid;
        grid-template-rows: auto 20px;
        padding-right: 100px;
        height: 100px;
    }

    & app-head[scrolled] {
        box-shadow: var(--header-box-shadow);
    }

    & app-body {
        overflow: scroll;
        display: block;
        position: relative;
        z-index: 9999;
    }
}

#docEditorSide toggle[preferences] toggle-item:before {
    content: attr(icon);
}

#docEditorSide {
    border-left: var(--edge);
    & app-head {
        /* padding: 5px; */ height: 50px;
        align-items: center;
        display: flex;
    }

    & toggle {
        /* margin-top: 5px; */ padding-bottom: 0px;
    }

    & app-body {
        overflow: hidden;
        background: rgb(246 246 246);
    }

    & app-panel {
        display: block;
        overflow: scroll;
        height: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    & #sidePanelInfo {
        & text {
            white-space: nowrap;
        }
    }

    & #docInfoComments {
        font-size: 13.5px;
        font-weight: 400;
        field-sizing: content;
        max-height: 300px;
        margin-top: -4px;
        min-width: 150px;
    }
}

#docTitle {
    font-size: 30px;
    font-weight: 500;
    display: flex;
    line-height: 30px;
    align-self: center;
    width: 100%;
    & textarea {
        all: inherit;
    }
}

#docInfo info-item + info-item:before {
    content: '  ‧  '
}

#docInfo {
    font-size: 12px;
    display: flex;
    align-items: center;
    color: rgba(0, 0, 0, .5);
    & info-item {
        display: inline-block;
        white-space: nowrap;
    }

    & #docInfoVersion {
        &:before {
            content: 'Revision ';
        }

        & select {
            all: revert;
            background: none;
            field-sizing: content;
            width: fit-content;
            font-size: inherit;
            color: inherit;
            appearance: none;
            border: none;
            margin-right: -25px;
            text-rendering: geometricPrecision;
            &:focus {
                outline: none;
            }
        }
    }

    & #docInfoTokens {
        &:after {
            content: ' Tokens'
        }
    }

    & #docInfoAllowance {
        &:after {
            content: '% Token Allowance Remaining'
        }
    }
}

score {
    --dial_background: var(--bracket_bg_color);
    --dial_color: var(--bracket_color);
    display: flex;
    position: absolute;
    flex-direction: column;
    height: 60px;
    width: 60px;
    top: 50%;
    right: 20px;
    translate: 0px -50%;
    background-color: var(--dial_background);
    background-image: radial-gradient(var(--dial_background) 0px, var(--dial_background) 27.5px, transparent 28px), conic-gradient(var(--dial_color) 0%, var(--dial_color) var(--percentage), transparent var(--percentage));
    border-radius: 100px;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    color: var(--dial_color);
    z-index: 9999;
    cursor: pointer;
    &:hover {
        box-shadow: 0px 0px 10px 0px cornflowerblue;
    }

    &:before {
        content: 'score';
        font-size: 10px;
        font-weight: 700;
        height: 0px;
        translate: 0px -11px;
        display: inline-block;
        opacity: 0;
    }

    &:after {
        translate: 0px 0px;
        font-size: 23px;
        font-weight: 600;
        content: attr(score);
    }
}

prompter {
    position: absolute;
    width: calc(100% - 74px);
    background: white;
    left: 37px;
    border-radius: 20px;
    min-height: 40px;
    top: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 5px;
    padding: 5px;
    padding-left: 35px;
    box-sizing: border-box;
    filter: drop-shadow(0px 0px .5px rgba(0, 0, 0, .25)) drop-shadow(0px 5px 5px rgba(0, 0, 0, .33));
    transition: top .125s ease-out;
    margin-top: .5em;
    z-index: 3;
    translate: 0px 0px;
    &:before {
        content: '􀆿';
        position: absolute;
        font-family: 'SF-Pro';
        font-size: 17px;
        left: 13px;
        top: 10px;
        opacity: .25;
    }

    &:after {
        content: '';
        position: absolute;
        top: 1px;
        display: block;
        height: 10px;
        width: 20px;
        background: white;
        left: 50%;
        translate: -50% -100%;
        clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
    }

    & input {
        all: revert;
        text-rendering: geometricPrecision;
        background: transparent;
        border: none;
        font-size: 15px;
        font-family: 'SF-Pro-Display';
        &:focus {
            outline: none;
        }
    }

    & > button {
        all: unset;
        background: #2a62d9;
        display: flex;
        height: 30px;
        width: 30px;
        border-radius: 100px;
        font-family: 'SF-Pro';
        align-items: center;
        justify-content: center;
        font-size: 15px;
        color: white;
        &:before {
            translate: 0px -1px;
        }

        &:focus {
            outline: var(--focus-outline);
        }
    }

    & message {
        overflow: hidden;
        display: flex;
        flex-direction: column;
        position: absolute;
        width: 100%;
        background: white;
        border-radius: 20px;
        box-sizing: border-box;
        z-index: -1;
        font-size: 16px;
        color: rgba(0, 0, 0, .8);
        top: 0px;
        opacity: 1;
        z-index: 99999;
        /* transition: translate 3s linear, opacity 3s linear; */
        gap: 10px;
        /* box-shadow: 0px 0px 10px 4px rgba(70, 146, 247, .75); */
        padding: 10px;
        &:not([active]) {
            translate: 0px 100%;
            opacity: 0;
        }

        &:before {
            content: '';
            display: block;
            position: absolute;
            height: 20px;
            width: 20px;
            background: red;
            top: -6px;
            display: none;
        }

        & text {
            x: 1;
            padding: 20px;
            border-radius: 15px;
            white-space: pre-line;
            &[role='text'] {
                x: 1;
                background: rgb(237 249 255);
                /* border: 1px solid; */
            }

            &[role='reason'] {
                background: rgba(0, 0, 0, .05);
                font-style: italic;
                color: rgba(0, 0, 0, .5);
                margin: 10px;
                border-radius: 10px;
                font-size: 14px;
                &:empty {
                    display: none;
                }
            }

            &[role='error'] {
                x: 1;
                background: rgb(255 0 0 / 5%);
                &:empty {
                    display: none;
                }
            }
        }

        & buttons {
            display: flex;
            justify-content: center;
            gap: 10px;
            & button {
                all: unset;
                font-family: 'SF-Pro';
                font-size: 25px;
                text-rendering: geometricPrecision;
                font-weight: 500;
                color: gray;
                border-radius: 100px;
                &:focus {
                    outline: var(--focus-outline);
                }
            }

            & #iconAccept {
                color: #24cf24;
            }

            & #iconReject {
                color: #df1f1f;
            }

            & #iconInfo {
                color: #27a0f5;
            }
        }
    }
}

#prompterSend[mode="edit"]:before {
    font-weight: 100;
    content: '􀉑';
}

#prompterSend[mode="auto"]:before {
    content: '􀜍';
    font-weight: 900;
}

[edit] {
    cursor: text;
    &:focus {
        outline: var(--focus-outline);
    }
}

text[editing] {
}

text[editing]:is(input, textarea) {
    all: inherit;
    height: 100%;
    width: 100%;
    field-sizing: content;
    outline: var(--focus-outline);
}

#docContent section textarea, doc-text-selection-block {
    font-size: 16px;
    text-rendering: geometricPrecision !important;
    font-weight: 400;
    field-sizing: content;
    display: flex;
    outline: none;
    border: none;
    line-height: 20px;
    color: rgba(0, 0, 0, .8);
    &:focus {
        outline: var(--focus-outline);
    }
}

#docContent section textarea {
    border-radius: 5px;
    outline: none !important;
    background: none;
}

doc-text-selection {
    font-family: 'SF-Pro-Display';
    box-sizing: border-box;
    font-size: 12px;
    font-weight: 500;
    padding: 5px;
    line-height: 14px;
    text-rendering: geometricPrecision;
    letter-spacing: .2px;
    resize: none;
    position: absolute;
    pointer-events: none;
    z-index: 1;
    padding: 25px;
}

doc-text-selection-block {
    display: inline;
    opacity: 0;
    white-space: pre-wrap;
    padding: 1px 0px;
}

doc-text-selection-block + doc-text-selection-block {
    background: rgb(180, 215, 255);
    opacity: 1;
    color: transparent;
}

#docContent {
    display: block;
    padding: 10px;
    padding-bottom: 50%;
    scroll-behavior: smooth;
    z-index: 2;
    position: relative;
    & section {
        display: flex;
        flex-direction: column;
        padding: 10px;
        & label {
            x: 1;
            font-weight: 600;
            opacity: .25;
            padding: 0px 5px;
        }
    }
}

app-section-card {
    display: grid;
    grid-template-rows: 50px auto;
    overflow: hidden;
}

app-section-card-head {
    display: flex;
    align-items: center;
    padding: 0px 10px;
    padding-left: 25px;
    box-shadow: var(--header-box-shadow);
    position: relative;
    background: white;
    z-index: 2;
    /* border-top: var(--edge); */
    & app-section-card-options {
        & icon- {
            padding: 0px;
            width: 28px;
        }
    }
}

app-section-card-body {
    height: auto;
    display: block;
    overflow: scroll;
    transition: height .125s linear;
    interpolate-size: allow-keywords;
}

app-section-card:not([open]) app-section-card-body {
    height: 0px;
}

app-section-card[open] app-section-card-body {
    border-bottom: var(--edge);
    max-height: 190px;
    /* min-height: 150px; */
}

app-section-card[open] app-section-card-body:empty:before {
    content: 'No items yet';
    font-size: 14px;
    display: flex;
    justify-content: center;
    padding: 10px;
    align-items: center;
    height: 100%;
    box-sizing: border-box;
    opacity: .3;
}

app-section-card-title {
    font-size: 16px;
    font-weight: 500;
    display: block;
    cursor: pointer;
    user-select: none;
    pointer-events: none;
    margin-right: auto;
}

#sideAttachmentsFilesTable {
    grid-template-columns: 25px 1fr auto;
    font-size: 13px;
    --table-custom-vertical-line: unset;
    outline: none;
    border: none;
    border-radius: 0px;
    /* border-bottom: var(--edge); */
    & .columnCheckbox {
        padding: 0px;
        justify-content: center;
        align-items: center;
        height: 100%;
        display: flex;
    }

    & table-custom-cell-value {
    }

    & table-custom-header-cell {
        justify-content: start;
    }
}

#sideAttachmentsFilesTable table-custom-header-cell:has(> .columnCheckbox) {
    padding: 0px;
    justify-content: center;
}

#dialogFiles {
    width: 500px;
    height: 500px;
    & #searchBarFiles {
        text-align: left;
    }

    & dialog-body {
        position: relative;
    }

    & dialog-body-wrap {
        display: grid;
        grid-auto-rows: auto 1fr;
        width: 100%;
        row-gap: 10px;
        height: 100%;
        /* overflow: hidden; */
        position: absolute;
        & scroll {
            display: block;
            overflow: scroll;
            border: var(--edge);
            border-radius: 6px;
            height: 100%;
            background: white;
        }
    }

    & table-custom-row[selected] {
        background: rgb(237 249 255);
        /* color: white; */
        /* text-rendering: auto; */
    }

    & table-custom {
        grid-template-columns: 40px 1fr auto;
        max-height: fit-content;
        text-align: left;
        font-size: 14px;
        border: none;
        & table-custom-cell {
            box-shadow: none;
        }

        & table-custom-cell-value {
            padding: 10px;
        }
    }
}

#dialogFiles table-custom-row:before {
    content: '􀉣';
    font-family: 'SF-Pro';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

#dialogFiles table-custom-row[selected]:before {
    opacity: .8;
}

::-webkit-resizer {
    appearance: none;
}

score-card {
    x: 1;
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    background: white;
    box-shadow: var(--menu_shadow);
    border-radius: 20px;
    border-top-right-radius: 40px;
    border: var(--edge);
    text-rendering: geometricPrecision;
    width: 400px;
    height: 75vh;
    box-sizing: border-box;
    resize: both;
    overflow: auto;
    grid-template-rows: auto auto auto;
    translate: 50px 0px;
    opacity: 0;
    pointer-events: none;
    transition: all .125s linear;
    &[open] {
        translate: 0px 0px;
        opacity: 1;
        pointer-events: all;
    }

    & score-card-head {
        display: block;
        padding: 0px 80px 20px 20px;
        border-bottom: var(--edge);
    }

    & score-card-head > score-card-title {
        /* text-align: center; */ font-size: 24px;
        font-weight: 700;
        display: flex;
        align-items: center;
        padding: 20px 80px 10px 0px;
        &:before {
            content: 'Refinement Scores';
        }
    }

    & score-card-options {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    & score-card-info {
        font-size: 13.33px;
        display: inline-flex;
        opacity: .8;
    }

    & score-card-sections {
        display: block;
        overflow: auto;
        margin: 0px;
    }

    & score-card-section {
        display: flex;
        flex-direction: column;
        border-radius: 10px;
        padding-bottom: 20px;
    }

    & score-card-section > score-card-title {
        font-size: 20px;
        font-weight: 500;
        text-transform: capitalize;
        height: 40px;
        padding: 0px 20px;
        position: sticky;
        top: 0px;
        background: white;
        z-index: 2;
        box-shadow: var(--header-box-shadow);
        align-items: center;
        display: flex;
    }

    & score-card-section: not([open]) score-card-items {
        display: none;
    }

    & score-card-items {
        display: flex;
        flex-direction: column;
        padding: 0px 20px;
    }

    & score-card-entry {
        grid-template-columns: 1fr auto;
        display: grid;
        box-sizing: border-box;
        color: rgba(0,0,0,.8);
        min-width: 200px;
        align-items: center;
        padding: 5px 0px;
        cursor: pointer;
        opacity: .5;
        & + score-card-entry {
            border-top: var(--edge);
        }

        &:not(&[open])[score="-"] {
            opacity: .25;
        }

        &[open] score-card-entry-value[role="info"] {
            display: block;
        }

        &[open] [role="label"] input[switch] {
            display: initial;
            margin-left: auto;
        }

        &:is([score="􀆅"],[score="􀆄"]) [role="score"] {
            text-transform: uppercase;
            font-family: 'SF-Pro';
        }

        & score-card-entry-value {
            x: 1;
            display: flex;
            align-items: center;
            &[role="info"] {
                grid-column: 1/3;
                display: none;
                overflow: hidden;
                font-size: 14px;
                padding: 10px 0px;
                word-break: break-word;
                opacity: .8;
                font-style: italic;
            }

            &[role="score"] {
                text-align: right;
                font-weight: 600;
                font-size: 14px;
                justify-content: end;
                height: 28px;
                width: 28px;
                display: flex;
                box-sizing: border-box;
                padding: 0px 10px;
                border-radius: 100px;
                justify-content: center;
                align-items: center;
                background: var(--bracket_bg_color);
                border2: .5px solid;
                color: var(--bracket_color);
            }

            &[role="label"] {
                font-weight: 500;
                white-space: nowrap;
                height: 30px;
                & input[switch] {
                    display: none;
                    margin-right: 10px;
                }
            }
        }
    }
}

score-card-entry-value:first-letter {
    text-transform: capitalize;
}

score-card-entry:has(input[switch]:checked) {
    opacity: 1;
}

button[busy]:after {
    content: '􀊯';
    font-family: 'SF-Pro';
    color: #aaa;
    display: inline-flex;
    translate: 4px 0px;
    animation: spin 2s linear infinite forwards;
}

@keyframes spin {
    from {
        rotate: 0deg;
    }

    to {
        rotate: 360deg;
    }
}

#goBack {
    position: absolute;
    left: 2px;
    top: 25px;
    font-weight: 700;
    opacity: 0.25;
}

#goBack:hover {
    opacity: 0.75;
}