/* draw: constructor and its explanation side by side, stacking when narrow */
.make {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25em 3em;
}
.make-aside { flex: 0 1 auto; max-width: 100%; }
.make-info {
    flex: 1 1 min(300px, 100%);
    align-self: center;
    max-width: 48ch;
}
.make-info p { font-size: .8em; margin-bottom: .5em; }
.make-form {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5em;
}

/* collect: custom first (your work lands here), built-in to learn from */
.collections {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5em 3em;
}
.coll { flex: 1 1 min(300px, 100%); }
.coll-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5em 1em;
    margin-bottom: .75em;
}
.coll-head label { font-size: .8em; white-space: nowrap; }

/* meta: share the page, credits */
.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1em 3em;
    justify-content: space-between;

    p {
        font-size: .8em;
    }
}
.meta-likely {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1em;
}
.meta-text {
    flex: 1 1 min(300px, 100%);
    max-width: 28ch;
}

.demo {
    position: relative;
    display: flex;
    --rs: 20px;
    --gap: 10px;
    --letterlink: var(--gap);
    --bg: #f5edc8;
    --gray: #79787273;
    width: calc(300px + (2 * var(--rs)));
    height: calc(300px + (2 * var(--rs)));
    max-width: 100%;
    background: var(--bg);
    padding: var(--rs);
    margin: .5em 0;
    border-radius: var(--rs);
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
}

.demo-text {
    line-height: 1.3;
}
.hl-r { color: rgb(197, 64, 64); font-weight: bold; }
.hl-b { color: rgb(42, 60, 216); font-weight: bold; }
.hl-g { color: green; font-weight: bold; }
.hl-gr { color: var(--gray);}

.demo-add_sym {
    margin-top: .5em;
}
.demo-add_sym input[type="text"] {
    font-size: 20px;
    padding: .25em;
    outline: none;
    border: 1px solid var(--input-bd);
    background-clip: padding-box;
}
.demo-add_sym-sym {
    width: 1.5em;
    text-align: center;
}
.demo-add_sym-sym:not(:valid) ~ .demo-add_sym-submit {
    color: var(--input-bd);
}
.demo-add_sym-error {
    color: rgb(197, 64, 64);
}

/* temporary group shown while a shared link's glyphs are active */
.import_syms {
    flex-basis: 100%;
    padding: .5em .75em .75em;
    background: rgba(127,127,127,.07);
    border-radius: 4px;
}

.demo-syms-placeholder {
    display: none;
    color: var(--gray);
    grid-column: -1/1;
    padding-left: 0 !important;
}
.demo-syms-placeholder:last-child { display: block; }

.demo-syms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4em, 1fr));
    grid-gap: 1em;
    width: 100%;
    padding: 0;
    list-style-type: none;
    font-family: monospace;
}
.demo-syms li {
    position: relative;
    line-height: 1.5;
    padding-left: 1em;

    &.nonunique {
        --cell-bg: var(--gray);
    }
}
.demo-syms .sym {
    --gap: 3px;
    --letterlink: var(--gap);
    --rs: .5em;
    height: 57px;
    cursor: pointer;
}
.demo-sym-remove {
    position: absolute;
    display: none;
    width: .6em;
    text-align: right;
    color: rgb(223, 130, 134);
    left: 0;
    top: 0;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
}
.demo-sym-remove:hover { color: var(--link-h);}
.demo-syms li:hover .demo-sym-remove {display: block;}


.demo-sym-sym {
    position: absolute;
    width: .6em;
    text-align: right;
    color: var(--gray);
    left: 0;
    bottom: -1px;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
}

.add-col-btn
, .remove-col-btn
{
    position: absolute;
    display: inline-block;
    line-height: 1;
    padding: .25em;
    color: var(--gray);
    cursor: pointer;
    transform: translate(-50%, -50%);
}
.add-col-btn:hover
, .remove-col-btn:hover
{ color: var(--link-h); }
.add-col-btn {
    right: -0.9em;
    top: 50%;
}
.remove-col-btn {
    bottom: -2.2em;
    left: 50%;
}

.demo-col {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-grow: 1;
}
.demo-cell {
    position: relative;
    touch-action: none;
    --demo-bg: transparent;
    height: calc((100% - var(--gap)) / 6);
    margin: calc(-1 * var(--gap));
    margin: var(--gap);
    background: var(--demo-bg);
    border: 1px dashed var(--gray);
    cursor: pointer;
}
.demo-cell.active::before {
    content: '';
    display: block;
    text-align: center;
    border: 1px dashed var(--gray);
    position: absolute;
    width: 40%;
    height: 30%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.demo-cell.active {
    --demo-bg: var(--cell-bg);
    border: none;
}
.demo-cell > div:hover {
    --gray: var(--link-h);
    cursor: pointer;
}
.demo-rs_tl
, .demo-rs_tr
, .demo-rs_bl
, .demo-rs_br
{
    display: none;
    width: var(--gap);
    height: var(--gap);
    position: absolute;
    border: calc(var(--gap)/2) solid var(--bg);
}
.demo-rs_tl { top: 0; left: 0; }
.demo-rs_tr { top: 0; right: 0; }
.demo-rs_bl { bottom: 0; left: 0; }
.demo-rs_br { bottom: 0; right: 0; }
.demo-rs_tl { border-bottom-color: transparent; border-right-color: transparent; }
.demo-rs_bl { border-top-color: transparent; border-right-color: transparent; }
.demo-rs_tr { border-bottom-color: transparent; border-left-color: transparent; }
.demo-rs_br { border-top-color: transparent; border-left-color: transparent; }
.demo-rs_tl::before
, .demo-rs_tr::before
, .demo-rs_bl::before
, .demo-rs_br::before
{
    content: '•';
    display: block;
    text-align: center;
    color: var(--gray);
    width: var(--gap);
    transform: translate(-50%, -50%);
}
.demo-cell.active .demo-rs_tl
, .demo-cell.active .demo-rs_tr
, .demo-cell.active .demo-rs_bl
, .demo-cell.active .demo-rs_br
{ display: block; }
.demo-rs_tl:not(.inactive)
, .demo-rs_tr:not(.inactive)
, .demo-rs_bl:not(.inactive)
, .demo-rs_br:not(.inactive)
{ --bg: transparent; }
.demo-cell.first-chain-cell .demo-rs_bl
, .demo-cell.first-chain-cell .demo-rs_br
, .demo-cell.chain-cell .demo-rs_tl
, .demo-cell.chain-cell .demo-rs_tr
, .demo-cell.chain-cell .demo-rs_bl
, .demo-cell.chain-cell .demo-rs_br
, .demo-cell.last-chain-cell .demo-rs_tl
, .demo-cell.last-chain-cell .demo-rs_tr
{ display: none; }


.demo-d_tl
, .demo-d_tr
, .demo-d_bl
, .demo-d_br
{
    display: none;
    width: calc(2* var(--gap));
    height: var(--gap);
    position: absolute;
    background: var(--demo-bg);
    z-index: 1;
}
.demo-d_tl { top: 0; left: calc(-2 * var(--gap)); }
.demo-d_tr { top: 0; right: calc(-2 * var(--gap)); }
.demo-d_bl { bottom: 0; left: calc(-2 * var(--gap)); }
.demo-d_br { bottom: 0; right: calc(-2 * var(--gap)); }
.demo-d_tl::before
, .demo-d_tr::before
, .demo-d_bl::before
, .demo-d_br::before
{
    content: '•';
    position: absolute;
    display: inline-block;
    z-index: 100;
    width: var(--gap);
    color: var(--gray);
    line-height: var(--gap);
}
.demo-d_tl::before
, .demo-d_bl::before
{ text-align: right; margin-left: var(--gap); }
.demo-cell.active .demo-d_tl
, .demo-cell.active .demo-d_tr
, .demo-cell.active .demo-d_bl
, .demo-cell.active .demo-d_br
{ display: block; }
.demo-d_tl:not(.active)
, .demo-d_tr:not(.active)
, .demo-d_bl:not(.active)
, .demo-d_br:not(.active)
{ --demo-bg: transparent; }
.demo-cell.first-chain-cell .demo-d_bl
, .demo-cell.first-chain-cell .demo-d_br
, .demo-cell.chain-cell .demo-d_tl
, .demo-cell.chain-cell .demo-d_tr
, .demo-cell.chain-cell .demo-d_bl
, .demo-cell.chain-cell .demo-d_br
, .demo-cell.last-chain-cell .demo-d_tl
, .demo-cell.last-chain-cell .demo-d_tr
{ display: none; }

.demo-link {
    position: absolute;
    display: none;
    bottom: calc(-2 * var(--gap));
    height: calc(2 * var(--gap));
    width: 100%;
    --demo-bg: transparent;
    background: var(--demo-bg);
}
.demo-link::before {
    content: '—';
    display: block;
    text-align: center;
    color: var(--gray);
}
.demo-link.linked {
    --demo-bg: var(--cell-bg);
}
.demo-cell.active.linkable .demo-link {
    display: block;
}
.demo-cell:not(.active) .demo-link.linked {
    --demo-bg: transparent;
}
.demo-cell:last-of-type .demo-link {
    display: none;
}

/*
demo-d_tl
demo-d_tr
demo-d_bl
demo-d_br
demo-rs_tl
demo-rs_tr
demo-rs_bl
demo-rs_br
demo-link
*/

.demo.attn {
    animation: demo-attn 1.2s ease-out 1;
}
@keyframes demo-attn {
    0% { box-shadow: 0 0 0 4px var(--link-h); }
    100% { box-shadow: 0 0 0 14px transparent; }
}

.import-banner {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .75em;
    margin: .75em 0 1em;
    padding: .5em .75em;
    background: rgba(127,127,127,.1);
    border-radius: 4px;
}
.import-banner-dismiss {
    margin-left: auto;
}


@media screen and (max-width: 920px) {
    .demo-sym-remove { display: block; }
}

.buy-coffee-link {
    position: relative;
    padding: 0.23em 0.5em 0.27em;
    background-color: #ffdd00;
    border-radius: 1em;
    line-height: 0.8;
    white-space: nowrap;
}
.buy-coffee-link:not(:hover):not(:active) {
    /* color: var(--text); */
}