/**********************************************************************************************************************
 * Legal Stuff:
 * 
 * Copyright Nick Overacker & Miho Kobayashi.
 * This code is offered under the Strict License 1.0.0 (https://polyformproject.org/licenses/strict/1.0.0/),
 * which permits users to use this code for noncommercial purposes but reserves most right for the copyright holders.
 * For uses not permitted under the license, please contact: nick.overacker@okstate.edu
 *********************************************************************************************************************/
 
/*------------*/
/*body*/
/*header 60*/
/*controls 130*/
/*edit-section 212*/
/*responsive 293*/
/*Canvas 444*/
/*truth-table 457*/
/*Dark-mode 498*/
/*Edit-open 619*/
/*------------*/

@import url('./josefin_sans.css');

html {
    overflow-y: scroll;
}

*{
    margin: 0;
    padding: 0;
    width: 100%;
    user-select: none; /* supported by Chrome and Opera */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
}

.light .logo {
    content:url("../images/Stixu-Logo.svg");
}

.dark .logo {
    content:url("../images/Stixu-Logo-darkmode.svg");
}

.pullup-pulldown-warning {
    text-align: center;
    background: red;
    visibility: hidden;
    font-size: small;
    height: 0;
}

.pullup-pulldown-warning.active {
    visibility: visible;
    height: auto;
}

.glowing {
    animation: glowing-animation 0.60s infinite alternate;
}

.rounded {
    border-radius: 100%;
}

@keyframes glowing-animation {
    from {
        box-shadow: 0 0 10px -10px #d4af37;
    }
    to {
        background-color: #d4af37;
        box-shadow: 0 0 10px 10px #d4af37;
    }
}

.tutorial-overlay {
    position: absolute;
    color: black;
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    width: auto;
    max-width: 300px;
    animation: bouncy 0.8s infinite alternate;
    animation-delay: 0.2s;
}

@keyframes bouncy {
    from { transform: scale(1) }
    to { transform: scale(0.9) }
}

a {
    text-decoration: inherit;
    color: inherit;
}

input[type="radio"] {
    display: none;
}

.active .terminalBtn {
    background-color: #D4AF37;
}

.terminal-select label {
    padding-top: 1.5vh;
    padding-bottom: 1.5vh;
    color: #221D1D;
}

.terminal-select > input:checked + label {
    background-color: #221D1D;
    color: #fff;
}

/*--------------truth-table-----------------*/
#truth-table-container {
    text-align: center;
    margin-top: 6vh;
    margin-bottom: 12vh;
    width: 50%;
    padding-left: 25%;
    padding-right: 25%;
    overflow-y: auto;
    font-size: 2.2vh;
    z-index: 1;
}

#truth-table-container table {
    border: 1px solid;
    margin: 0;
    padding: 0;
    border-collapse: collapse;
    width: 100%;
}

#truth-table-container table .header {
    border: 1px solid;
    padding: 5px;
}

#truth-table-container table td {
    border: 1px dotted;
    width: auto;
}

#truth-table-container table td.output {
    border-left: 3px double;
    border-right: 3px double;
    font-weight: bold;
}
/*--------------truth-table-end-----------------*/

/*-------Dark-mode-----*/
.dark .edit-back {
    color: #221D1D;
    background:#FFFFFF;
}

.dark .evaluate-btn {
    color: #FFFFFF;
    background:#4C26B8;
}

.dark .icon-back {
    color: #FFFFFF;
    background:rgba(109,110,106,.7);
}

/*---------Main-Menu------------*/
li{
    list-style: none;
}

.inline {
    display: inline;
}

.fa-times{
    position: relative;
    color: #FFFFFF;
    width: unset;
}

/*-------------------------------*/

/*-----------Edit-open-------------*/
.edit-open{
    width: 100%;
    height: 100vh;
    background-color: rgba(76,38,184,98%);
    position: sticky;
    top: 0;
    right: 0;
    z-index: 1000;
}

#edit-close{
    color: #FFFFFF;
    font-size: 30px;
    position: relative;
    top: 20px;
    left:40px;
}

.terminal{
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    align-items: center;
    margin-top: 15vh;
    font-family: 'Josefin Sans', sans-serif;
}

.terminal h3{
    font-size: 25px;
    color: #FFFFFF;
    text-transform: uppercase;
}

.terminal-select {
    display: flex;
    flex-wrap: wrap;            /* up to 18 terminals: wrap rather than squeeze */
    overflow: hidden;
    background-color: rgba(255,255,255,.8);
    padding-top: 0;
    padding-bottom: 0;
}

.terminal-select label {
    width: auto;                /* the global rule makes everything 100% wide */
    flex: 1 0 auto;
    padding-left: 0.4em;
    padding-right: 0.4em;
    text-align: center;
}

.terminal-select2{
    margin-top: 30px;
    display: flex;
}

.terminalBtn{
    font-size: 25px;
    margin: 10px;
    padding: 20px;
    width: 20px;
    height: 20px;
    border-radius: 10px;
    color: #221D1D;
    box-shadow: rgba(0, 0, 0, 0.08) 0px 4px 12px;
    background-color: rgba(255,255,255,.8);
    text-align: center;
}

.select-content{
    flex-direction: column;
    text-align: center;
}

span.small
{
    font-size: 12px;
    color: #FFFFFF;
    margin-top: 0;
    display: block;
}
/*---------------------------Edit-open-end*/

.no-controls .controls, .closed {
    display: none;
}

.no-controls .canvas-group {
    width: 100%;
    margin-left: 0;
}

.no-controls .canvas-wrapper {
    width: 100%;
    height: min(85vh,100vw);
    margin-left: auto;
    margin-right: auto;
}

canvas {
    padding-left: 0;
    padding-right: 0;
    margin-left: auto;
    margin-right: auto;
    display: block;
    touch-action: none;
}

body.dark {
    background: #221D1D;
    color: #ffffff;
}

body.light {
    background: #ffffff;
    color: #000000;
}

.clickable{
    cursor: pointer;
}

/*--------Header----------*/
.overall-header{
    justify-content: center;
    display: flex;
}

.header-left {
    width: 25%;
    text-align: center;
    margin-top: auto;
    margin-bottom: auto;
}

.header-center {
    width: 50%;
    text-align: center;
    margin-top: auto;
    margin-bottom: auto;
}

.header-right {
    width: 25%;
    text-align: center;
    margin-top: auto;
    margin-bottom: auto;
}

.header-button {
    font-size: 30px;
    padding: 10px;
    color: #FFFFFF;
    background: linear-gradient(180deg, #832AF4 0%, rgba(80, 84, 186, 0.99) 100%);
    border-radius: 100%;
    width: 30px;
    height: 30px;
    justify-content: center;
}

.instructions{
    width: auto;
    padding: 10px;
    color: #FFFFFF;
    justify-content: center;
    text-align: center;
    position: relative;
    left: 30px;
    font-size: 25px;
    font-family: 'Josefin Sans', sans-serif;
    background: #4C26B8;
}

#dark-mode{
    margin-left: 50px;
    margin-top: 10px;
    font-size: 30px;
    color: #4C26B8;
}

/*--------Header-end----------*/
.main{
    display: flex;
    
}

/*-------Controls--------*/
.controls{
    margin-top: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.rowBtn-1{
    display: flex;
    justify-content: center;
    text-align: center;
}

.rowBtn{
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.row-content{
    display: flex;
    justify-content:center;
    text-align: center;
    margin-bottom: 1vh;
    font-size: 2.5vh;
    font-weight: bold;
    font-family: 'Josefin Sans', sans-serif;
}

#row-number{
    margin-left: 10px;
    padding: 10px;
    box-shadow: rgba(9, 30, 66, 0.25) 0px 1px 1px, rgba(9, 30, 66, 0.13) 0px 0px 1px 1px;
}

#col-number{
    margin-left: 10px;
    padding: 10px;
    box-shadow: rgba(9, 30, 66, 0.25) 0px 1px 1px, rgba(9, 30, 66, 0.13) 0px 0px 1px 1px;
}

.icon-back{
    font-size: 20px;
    padding: 10px;
    color: #FFFFFF;
    background:#221D1D;
    width: 20px;
    height: 20px;
    justify-content: center;
    text-align: center;
    border-radius: 10%;
}

.rowBtn-2{
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    margin-top: 10px;
}

.colorChange{
    display: flex;
    justify-content: center;
    text-align: center;
    margin-top: 30px;
    width: 200px;
    order: 1;
}

.fa-circle{
    font-size: 30px;
    margin: 10px;
}

/*-------Controls-END--------*/

/*-----Edit-section-------*/

.edit-btn{
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 50%;
    position: relative;
    margin-top: 10px;
    order: 2;
}

.edit-back{
    font-size: 2vw;
    height: 2vw;
    width: 2vw;
    border: solid 2px;
    padding: 1vw;
    border-radius: 100%;
}

.edit-back.small {
    height: 2.6vh;
    width: 2.6vh;
    font-size: 2.6vh;
    padding: 1.3vh;
}

.edit-btn-content h5{
    font-size: 2vh;
    font-weight: bold;
    margin-top: 1vh;
    margin-bottom: 2vh;
}
/*-----Edit-section-end-------*/

.evaluate-btn{
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    font-family: 'Josefin Sans', sans-serif;
    width: 300px;
    height: 50px;
    background-color: #221D1D;
    color: #FFFFFF;
    margin-top: 30px;
    order: 5;
}

.icon-back:active{
    background:#4C26B8;
}

.fa-circle:active{
    opacity: .7;
}

.evaluate-btn:active{
    background-color: #4C26B8;
}

@media (hover: hover) {
    .icon-back:hover{
        background:#4C26B8;
        transition: .5s;
    }

    .fa-circle:hover{
        opacity: .7;
        transition: .5s;
    }

    .evaluate-btn:hover{
        background-color: #4C26B8;
        transition: .5s;
    }

    .clickable:hover {
        color: #d4af37;
        transition: .5s;
    }

    .dark .icon-back:hover {
        background:#4C26B8;
        transition: .5s;
    }

    .terminal-select label:hover{
        background-color: rgba(76,38,184,.9);
        color: #FFFFFF;
        transition: .5s;
    }
}

/*-------responsive--------*/
@media screen and (orientation: landscape){
    .overall-header {
        top: 2vh;
        height: 13vh;
        position: absolute;
    }

    .controls{
        margin-top: 18vh;
        position: relative;
    }

    .logo {
        max-width: 100%;
        max-height:50px;
    }

    .fa-times{
        font-size: 2.5vw;
        padding: 2.5vw;
    }

    .edit-btn-content.small {
        display: none;
    }

    /*-------------Canvas---------------*/
    .canvas-group {
        margin-top: 15vh;
        margin-left: 15vh;
    }

    .canvas-wrapper {
        width: min(80vh, 80vw);
        height: min(80vh, 80vw);
    }

    .active-layers {
        width: 11vh;
        height: 20vh;
        margin-left: -13vh;
        margin-top: 30vh;
        position: absolute;
    }

    #CONTACT {
        height: 20vh;
        width: 5vh;
        margin-left: 3vh;
        position: absolute;
    }

    .cmos-layer {
        height: 5vh;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /*-------------Canvas-END---------------*/

    .evaluate-btn{
        margin-left: auto;
        margin-right: auto;
        order: 5;
    }

    .offscreen {
        display: flex;
        flex-direction: column;
        order: 2;
    }

    .truth-table-section {
        order: 6;
    }

    #results {
        order: 7;
    }

    .edit-open {
        margin-top: -18vh;
        position: absolute;
    }

    .terminal-select {
        margin-top: 30px;
        max-width: 80%;
        border-radius: 10px;
    }

    .terminal-select label {
        font-size: 1.3vw;
    }

    .terminal-select label.first {
        border-radius: 10px 0 0 10px;
    }

    .terminal-select label.last {
        border-radius: 0 10px 10px 0;
    }
}

@media screen and (orientation: portrait){

    .fa-times {
        font-size: 5vh;
        margin-left: auto;
        margin-right: auto;
        margin-top: 1vh;
        padding: 1vh;
        width: 5vh;
        height: 5vh;
        text-align: center;
        display: block;
    }

    .terminal h3{
        display: none;
    }

    .terminal {
        margin-top: 0;
    }

    .terminal-select {
        max-width: 100%;
        margin-top: 0;
        border-radius: 0;
    }

    .terminal-select2 {
        margin-top: 1vh;
        max-width: 100%;
    }

    h3 {
        font-size: 2vh;
    }

    .select-content .small {
        display: none;
    }

    .terminalBtn {
        font-size: 1.8vh;
        padding: 1.8vh;
        width: 1.8vh;
        height: 1.8vh;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    .overall-header{
        position: relative;
        top: 0;
        padding-top: 2vh;
        padding-bottom: 2vh;
    }

    .header-button {
        font-size: 4vh;
        width: 4vh;
        height: 4vh;
    }

    #menu-bar {
        left: 90%;
    }

    .logo {
        /*font-size: 4vh;*/
        max-height: 50px;
        max-width: 100%;
    }

    .controls{
        margin-top: 2vh;
    }

    .main{
        flex-direction: column;
    }

    .canvas-group {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .canvas-wrapper{
        width:100%;
        height: min(62vh, 100vw);
        margin-left: 0;
        margin-top: 0;
    }

    .row-content{
        font-size: 2.5vh;
        margin-bottom: 1vh;
    }
    
    .offscreen {
        position: absolute;
        top: 100vh;
    }

    .icon-back{
        padding: 20px;
        color: #FFFFFF;
        background:#221D1D;
        align-items: center;
        margin: 10px;
        margin-top: 0;
    }

    .rowBtn-2{
        display: flex;
        flex-direction: column;
        justify-content: center;
        text-align: center;
        margin-top: 10px;
    }

    .colorChange{
        display: flex;
        justify-content: center;
        text-align: center;
        margin-top: 0;
        width: 90%;
        order: 0;
    }

    .fa-circle{
        font-size: 4vh;
        margin: 2vh;
        margin-bottom: 3vh;
    }

    .edit-back{
        font-size: 5.3vh;
        height: 5.3vh;
        width: 5.3vh;
        border: solid 2px;
        padding: 2.6vh;
        border-radius: 100%;
    }

    .edit-btn {
        margin-top: 0;
        width: 100%;
        order: 0;
    }

    .edit-btn-content h5{
        display: none;
    }

    .edit-btn-content.small {
        display: inline-block;
        width: 50%;
    }

    .evaluate-btn{
        font-size: 40px;
        width: 100%;
        height: 80px;
        margin-top: 20px;
        order: 0;
    }
}

/*---------Menu drawer------------*/
/* A panel that slides in from the right, with one page shown at a time. */
.menu-drawer {
    --menu-bg: #FFFFFF;
    --menu-fg: #221D1D;
    --menu-muted: #6B6470;
    --menu-rule: #E7E2EE;
    --menu-hover: #F3EFFA;
    --menu-accent: #4C26B8;
    --menu-accent-fg: #FFFFFF;
    --menu-kbd-bg: #F6F3FA;
    --menu-kbd-border: #D4CCE3;
    --menu-danger: #B3261E;
    --menu-focus: #832AF4;
}

.dark .menu-drawer {
    --menu-bg: #2B2526;
    --menu-fg: #F4F1F1;
    --menu-muted: #B5ACAF;
    --menu-rule: #403738;
    --menu-hover: #3A3133;
    --menu-accent: #A68CFF;
    --menu-accent-fg: #1A1415;
    --menu-kbd-bg: #372E30;
    --menu-kbd-border: #5A4E50;
    --menu-danger: #FF8A80;
    --menu-focus: #B79CFF;
}

html.menu-open {
    overflow: hidden;
}

/* The global "* { width: 100% }" rule does not suit the drawer's contents. */
.menu-drawer * {
    width: auto;
}

.menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
    z-index: 9998;
}

.menu-backdrop.open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease;
}

.menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--menu-bg);
    color: var(--menu-fg);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.28);
    font-family: 'Josefin Sans', sans-serif;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.25s;
    z-index: 9999;
}

.menu-drawer.open {
    transform: none;
    visibility: visible;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.menu-drawer button,
.menu-drawer a {
    font: inherit;
    color: inherit;
}

.menu-drawer :focus-visible {
    outline: 2px solid var(--menu-focus);
    outline-offset: -2px;
    border-radius: 6px;
}

.menu-header {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 60px;
    padding: 0 8px;
    border-bottom: 1px solid var(--menu-rule);
    flex-shrink: 0;
}

.menu-title {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 700;
    padding-top: 3px; /* Josefin Sans sits high in its line box. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-icon-btn {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.menu-icon-btn.invisible {
    visibility: hidden;
}

.menu-pages {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.menu-page {
    padding: 4px 0 32px;
}

.menu-page[hidden] {
    display: none;
}

.menu-page.enter-forward {
    animation: menu-enter-forward 0.22s ease;
}

.menu-page.enter-back {
    animation: menu-enter-back 0.22s ease;
}

@keyframes menu-enter-forward {
    from { transform: translateX(32px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

@keyframes menu-enter-back {
    from { transform: translateX(-32px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.menu-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--menu-muted);
    padding: 20px 20px 6px;
}

.menu-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 48px;
    padding: 10px 20px;
    box-sizing: border-box;
    border: 0;
    background: none;
    text-align: left;
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.3;
    cursor: pointer;
}

.menu-row > .fas:first-child {
    width: 20px;
    text-align: center;
    color: var(--menu-accent);
    flex-shrink: 0;
}

.menu-row-label {
    flex: 1;
    padding-top: 3px;
}

.menu-row-sub {
    display: block;
    font-size: 0.85rem;
    color: var(--menu-muted);
    margin-top: 2px;
}

.menu-row-end,
.menu-row-hint {
    color: var(--menu-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.menu-row-hint {
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

.menu-row:active {
    background: var(--menu-hover);
}

@media (hover: hover) {
    .menu-row:hover,
    .menu-icon-btn:hover,
    .menu-button:hover,
    .shortcut-key:hover,
    .shortcut-reset:hover {
        background: var(--menu-hover);
    }
}

.menu-row-done .menu-row-label {
    color: var(--menu-accent);
}

/* On/off switch drawn at the end of a row with role="switch". */
.menu-switch {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 12px;
    background: var(--menu-rule);
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.menu-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--menu-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease;
}

[aria-checked="true"] > .menu-switch {
    background: var(--menu-accent);
}

[aria-checked="true"] > .menu-switch::after {
    transform: translateX(18px);
}

.menu-setting {
    padding: 16px 20px 8px;
}

.menu-setting-label {
    display: block;
    margin-bottom: 10px;
}

.menu-segmented {
    display: flex;
    border: 1px solid var(--menu-rule);
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
}

.menu-segmented button {
    flex: 1;
    min-height: 36px;
    border: 0;
    border-radius: 7px;
    background: none;
    cursor: pointer;
    padding-top: 3px;
}

.menu-segmented button[aria-checked="true"] {
    background: var(--menu-accent);
    color: var(--menu-accent-fg);
    font-weight: 700;
}

.menu-prose {
    padding: 4px 20px 8px;
    font-size: 0.95rem;
    line-height: 1.55;
    user-select: text;
    -webkit-user-select: text;
}

.menu-prose * {
    user-select: text;
    -webkit-user-select: text;
}

.menu-prose h3 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--menu-muted);
    margin: 18px 0 8px;
}

.menu-prose p {
    margin: 0 0 12px;
}

.menu-prose ul {
    padding-left: 18px;
}

.menu-prose li {
    list-style: disc;
    margin-bottom: 8px;
}

.menu-prose a {
    color: var(--menu-accent);
    text-decoration: underline;
}

.menu-symbols {
    display: grid;
    grid-template-columns: 2em 1fr;
    gap: 6px 10px;
    margin: 4px 0 8px;
}

.menu-symbols dt {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-weight: 700;
    text-align: center;
    color: var(--menu-accent);
}

.menu-intro {
    padding: 16px 20px 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--menu-muted);
}

.menu-drawer kbd {
    display: inline-block;
    min-width: 1.4em;
    padding: 3px 6px 2px;
    border: 1px solid var(--menu-kbd-border);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--menu-kbd-bg);
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.menu-footer {
    padding: 20px;
}

.menu-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 4px 16px 0;
    border: 1px solid var(--menu-rule);
    border-radius: 10px;
    background: none;
    cursor: pointer;
}

.menu-button:disabled {
    opacity: 0.45;
    cursor: default;
    background: none;
}

.menu-button.primary {
    background: var(--menu-accent);
    border-color: var(--menu-accent);
    color: var(--menu-accent-fg);
    font-weight: 700;
}

.menu-license {
    padding: 12px 20px;
    border-bottom: 1px solid var(--menu-rule);
}

.menu-license-name {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
}

.menu-license-links a {
    color: var(--menu-accent);
    text-decoration: underline;
    margin-right: 16px;
    font-size: 0.95rem;
}

/* Keyboard shortcuts page */
.shortcut-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    padding: 2px 12px 2px 20px;
    min-height: 44px;
}

.shortcut-label {
    flex: 1;
    min-width: 0;
    padding-top: 3px;
    line-height: 1.3;
}

.shortcut-key {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 36px;
    padding: 0 8px;
    border: 1px dashed transparent;
    border-radius: 8px;
    background: none;
    cursor: pointer;
}

.shortcut-key.modified kbd {
    border-color: var(--menu-accent);
}

.shortcut-key.capturing {
    border-color: var(--menu-accent);
    color: var(--menu-accent);
    font-size: 0.85rem;
    padding-top: 3px;
}

.shortcut-fixed {
    display: inline-flex;
    gap: 4px;
    padding: 0 8px;
    color: var(--menu-muted);
}

.shortcut-reset {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    color: var(--menu-muted);
}

.shortcut-reset.invisible {
    visibility: hidden;
}

.shortcut-message {
    flex-basis: 100%;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--menu-danger);
    padding: 2px 0 6px;
}

.shortcut-message.info {
    color: var(--menu-muted);
}

.shortcut-message .menu-button {
    min-height: 32px;
    margin: 8px 8px 0 0;
    font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
    .menu-drawer,
    .menu-drawer.open,
    .menu-backdrop,
    .menu-backdrop.open,
    .menu-switch,
    .menu-switch::after {
        transition: none;
    }

    .menu-page.enter-forward,
    .menu-page.enter-back {
        animation: none;
    }
}
/*---------Menu drawer-end------------*/

/*---------Logical effort panel------------*/
/* A side panel that leaves the canvas usable, so stages can be highlighted while reading the results. */
.effort-panel {
    --effort-bg: #FFFFFF;
    --effort-fg: #221D1D;
    --effort-muted: #6B6470;
    --effort-rule: #E3DEEA;
    --effort-accent: #4C26B8;
    --effort-accent-fg: #FFFFFF;
    --effort-warn: #B26A00;
    position: fixed;
    top: 0;
    right: 0;
    width: min(400px, 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--effort-bg);
    color: var(--effort-fg);
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.25);
    font-family: 'Josefin Sans', sans-serif;
    z-index: 5000;
}

.dark .effort-panel {
    --effort-bg: #2B2526;
    --effort-fg: #F4F1F1;
    --effort-muted: #B5ACAF;
    --effort-rule: #433A3B;
    --effort-accent: #A68CFF;
    --effort-accent-fg: #1A1415;
    --effort-warn: #FFB340;
}

.effort-panel.closed {
    display: none;
}

/* The global "* { width: 100% }" rule does not suit the panel's contents. */
.effort-panel * {
    width: auto;
}

.effort-panel button,
.effort-panel input {
    font: inherit;
    color: inherit;
}

.effort-panel :focus-visible {
    outline: 2px solid var(--effort-accent);
    outline-offset: 2px;
}

.effort-header {
    display: flex;
    align-items: center;
    padding: 8px 8px 8px 20px;
    border-bottom: 1px solid var(--effort-rule);
}

.effort-header h2 {
    flex: 1;
    font-size: 1.2rem;
    padding-top: 3px;
}

.effort-icon-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    font-size: 1.1rem;
}

.effort-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 32px;
}

.effort-params {
    display: grid;
    grid-template-columns: 1fr 80px;
    gap: 10px 12px;
    align-items: center;
    margin-bottom: 14px;
}

.effort-params input {
    width: 80px;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid var(--effort-rule);
    border-radius: 6px;
    background: transparent;
}

.effort-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 6px;
    border: 0;
    border-radius: 8px;
    background: var(--effort-accent);
    color: var(--effort-accent-fg) !important;
    font-weight: 700;
    cursor: pointer;
}

.effort-message {
    margin-top: 14px;
    color: var(--effort-muted);
    font-size: 0.9rem;
}

.effort-stage {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid var(--effort-rule);
    border-radius: 10px;
}

.effort-stage-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.effort-stage-header h3 {
    flex: 1;
    font-size: 1rem;
    padding-top: 2px;
}

.effort-show {
    padding: 4px 10px 2px;
    border: 1px solid var(--effort-rule);
    border-radius: 6px;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
}

.effort-stage table {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.effort-stage th,
.effort-stage td {
    padding: 4px 6px;
    text-align: right;
    border-bottom: 1px solid var(--effort-rule);
}

.effort-stage th:first-child,
.effort-stage td:first-child {
    text-align: left;
}

.effort-stage th {
    color: var(--effort-muted);
    font-weight: 600;
}

.effort-stage p,
.effort-stage details {
    margin-top: 8px;
    font-size: 0.9rem;
}

.effort-stage summary {
    cursor: pointer;
    color: var(--effort-muted);
}

.effort-stage details li {
    list-style: none;
    padding-left: 12px;
}

.effort-note {
    margin-top: 20px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--effort-muted);
}

.effort-notice {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid var(--effort-warn);
    border-left-width: 6px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--effort-warn) 10%, transparent);
}

.effort-notice h3 {
    font-size: 1rem;
    padding-top: 2px;
}

.effort-notice > p {
    margin-top: 6px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.effort-notice li {
    list-style: none;
    margin-top: 10px;
}

.effort-notice .effort-reason {
    margin-top: 2px;
    font-size: 0.85rem;
    color: var(--effort-muted);
}

.effort-section-title {
    margin-top: 22px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--effort-muted);
}

.effort-panel select {
    font: inherit;
    color: inherit;
    padding: 5px 6px;
    border: 1px solid var(--effort-rule);
    border-radius: 6px;
    background: var(--effort-bg);
}

.effort-params select {
    width: 80px;
    box-sizing: border-box;
}

/* A select too wide for the value column takes the whole row, under its label. */
.effort-params select.effort-wide {
    grid-column: 1 / -1;
    width: 100%;
}

.effort-params input[type="checkbox"] {
    width: 20px;
    height: 20px;
    justify-self: end;
}

.effort-panel details > summary {
    margin-top: 10px;
}

.effort-panel details + div {
    margin-top: 14px;
}

.effort-stage td {
    white-space: nowrap;
}

.effort-list-heading {
    margin-top: 8px;
    font-weight: 700;
    padding-left: 0 !important;
}

.effort-branch {
    list-style: none;
    margin-top: 10px;
}

.effort-branch .effort-params {
    margin: 6px 0 0;
}

@media screen and (orientation: portrait) {
    .effort-panel {
        top: auto;
        bottom: 0;
        width: 100%;
        height: 60vh;
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.25);
        border-radius: 14px 14px 0 0;
    }
}
/*---------Logical effort panel-end------------*/

/*---------Goals---------------------------------*/
.goal-panel,
#goal-builder {
    --goal-rule: var(--effort-rule, var(--menu-rule));
    --goal-muted: var(--effort-muted, var(--menu-muted));
    --goal-accent: var(--effort-accent, var(--menu-accent));
    --goal-pass: #1B7F3B;
    --goal-fail: #B3261E;
}

.dark .goal-panel,
.dark #goal-builder {
    --goal-pass: #6FD58E;
    --goal-fail: #FF8A80;
}

.goal-title {
    font-size: 1.15rem;
    padding-top: 2px;
}

.goal-description {
    margin-top: 8px;
    white-space: pre-wrap;
    line-height: 1.45;
}

.goal-requirements {
    margin-top: 8px;
    padding-left: 20px;
}

.goal-requirements li {
    margin-top: 8px;
    line-height: 1.4;
}

.goal-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.goal-table {
    margin-top: 8px;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.goal-table th,
.goal-table td {
    padding: 3px 8px 1px;
    border-bottom: 1px solid var(--goal-rule);
    text-align: center;
}

.goal-table th {
    color: var(--goal-muted);
    font-weight: 700;
}

.goal-table .goal-first-output {
    border-left: 2px solid var(--goal-rule);
}

.goal-dont-care {
    color: var(--goal-muted);
}

.goal-results {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid var(--goal-fail);
    border-left-width: 6px;
    border-radius: 10px;
}

.goal-results.passed {
    border-color: var(--goal-pass);
}

.goal-results h4 {
    font-size: 1rem;
    padding-top: 2px;
}

.goal-result {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    line-height: 1.4;
}

.goal-result > .fas {
    margin-top: 2px;
}

.goal-result.pass > .fas {
    color: var(--goal-pass);
}

.goal-result.fail > .fas {
    color: var(--goal-fail);
}

.goal-result p {
    margin-top: 2px;
    font-size: 0.9rem;
    color: var(--goal-muted);
}

/* The Create a goal page, in the menu drawer. */
.goal-form {
    padding: 4px 20px 8px;
}

.goal-form > .menu-group-title {
    padding-left: 0;
    padding-right: 0;
}

.goal-form label {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
}

.goal-form input[type="text"],
.goal-form input[type="number"],
.goal-form textarea,
.goal-form select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
    padding: 7px 8px 5px;
    border: 1px solid var(--goal-rule);
    border-radius: 6px;
    background: var(--menu-bg);
    color: inherit;
    font: inherit;
}

.goal-form textarea {
    min-height: 5em;
    resize: vertical;
}

.goal-form label.goal-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 1rem;
}

.goal-check input {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin: 0;
}

.goal-limit .goal-fields {
    margin-left: 26px;
}

.goal-fields:not(.goal-limit .goal-fields) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

.goal-fields:not(.goal-limit .goal-fields) .goal-hint {
    grid-column: 1 / -1;
}

.goal-hint {
    margin-top: 6px;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--goal-muted);
}

.goal-cell {
    min-width: 2em;
    padding: 3px 6px 1px;
    border: 1px solid var(--goal-rule);
    border-radius: 6px;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.goal-error {
    margin-top: 8px;
    color: var(--goal-fail);
    font-size: 0.9rem;
}
/*---------Goals-end-----------------------------*/

/*---------Zoom and navigate-----------------------*/
.edit-back.active {
    background: #4C26B8;
    border-color: #4C26B8;
    color: #FFFFFF;
}

.dark .edit-back.active {
    background: #A68CFF;
    border-color: #A68CFF;
    color: #1A1415;
}

#canvas.navigating {
    cursor: zoom-in;
}

.zoom-fit-btn {
    position: absolute;
    z-index: 5;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 4px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: #221D1D;
    font: 600 14px/1 'Josefin Sans', sans-serif;
    cursor: pointer;
}

.zoom-fit-btn[hidden] {
    display: none;
}

.dark .zoom-fit-btn {
    background: rgba(43, 37, 38, 0.92);
    border-color: rgba(255, 255, 255, 0.3);
    color: #F4F1F1;
}
/*---------Zoom and navigate-end-------------------*/

/* The Magic layout page. */
.magic-hint {
    margin: 10px 0 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--menu-muted);
}

.magic-unit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.magic-unit[hidden] {
    display: none;
}

.magic-unit input {
    width: 5em;
    padding: 6px 8px 4px;
    border: 1px solid var(--menu-rule);
    border-radius: 6px;
    background: var(--menu-bg);
    color: inherit;
    font: inherit;
}
