:root {
    --color-text: #0f0f0f;
    --color-muted: #606060;
    --color-bg: #ffffff;
    --color-muted-bg: rgba(0, 0, 0, 0.05);
    --color-muted-bg-dark: rgba(0, 0, 0, 0.1);
    --color-code-bg: #f2f2f2;
    --color-pre-bg: #f8f8f8;
    --color-figcaption: #666666;
    --color-mark: orange;
}

*,
*::before,
*::after,
::backdrop {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0 solid;
}

@media (-o-min-device-pixel-ratio: 2),
    (-webkit-min-device-pixel-ratio: 2),
    (min--moz-device-pixel-ratio: 2),
    (min-device-pixel-ratio: 2),
    (min-resolution: 192dpi),
    (min-resolution: 2x) {
    :root {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

html,
body {
    font-family:
        ui-sans-serif,
        -apple-system,
        system-ui,
        "Segoe UI",
        Helvetica,
        "Apple Color Emoji",
        Arial,
        sans-serif,
        "Segoe UI Emoji",
        "Segoe UI Symbol";
    font-feature-settings: normal;
    font-variation-settings: normal;
    font-size: 16px;
    tab-size: 4;
    line-height: 1.65;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    color: var(--color-text);
    background-color: var(--color-bg);
    margin: auto;
    overflow-wrap: break-word;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    padding: 16px;
}

/* Заголовки */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin: 36px 0 16px;
}
h1 {
    font-size: 20px;
    line-height: 36px;
    margin-block-end: 16px;
}
h2 {
    font-size: 22px;
    line-height: 28px;
}
h3 {
    font-size: 20px;
    margin-block-end: 22px;
}
h4 {
    font-size: 18px;
}
h5 {
    font-size: 17px;
}
h6 {
    font-size: 16px;
}

/* Текст */
p {
    margin: 20px 0;
    font-weight: 350;
}
strong {
    font-weight: 600;
}
em {
    font-style: italic;
}
a:hover {
    text-decoration: underline;
}
::marker {
    color: var(--color-muted);
}

/* Списки */
ul,
ol {
    padding-left: 24px;
    margin: 20px 0;
}
li {
    margin: 6px 0;
}

/* Кнопки */
button,
a.button,
.button {
    cursor: pointer !important;
    background: var(--color-muted-bg);
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--color-text);
    font-size: 16px;
    font-weight: 450;
    padding: 8px 12px;
    text-decoration: none;
    backdrop-filter: blur(2px);
}
button:hover,
a.button:hover {
    background-color: var(--color-muted-bg-dark);
}
button:disabled,
.button:disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* Формы */
input,
textarea {
    background: var(--color-muted-bg);
    backdrop-filter: blur(2px);
    border-radius: 4px;
    font-size: 16px;
    padding: 6px 12px;
    color: var(--color-text);
    box-shadow: inset 0px 1px 1px var(--color-muted-bg-dark);
    width: 100%;
}
input[type="file"] {
    background: transparent;
    box-shadow: none;
}

/* Блоки */
blockquote {
    margin: 24px 0;
    margin-inline-start: 24px;
    padding-left: 16px;
    border-left: 4px solid var(--color-muted-bg);
    color: var(--color-muted);
    font-style: italic;
    font-size: 16px;
}
mark.current-match {
    background-color: var(--color-mark);
}

/* Код */
code {
    font-family: monospace;
    background-color: var(--color-code-bg);
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 14px;
}
pre {
    font-family: monospace;
    background: var(--color-pre-bg);
    padding: 16px;
    overflow-x: auto;
    border-radius: 4px;
    line-height: 1.45;
    font-size: 14px;
}

/* Таблицы */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 32px 0;
    font-size: 15px;
}
th,
td {
    border: 1px solid var(--color-muted-bg);
    padding: 10px 14px;
    text-align: left;
}
th {
    background: var(--color-muted-bg);
    font-weight: 600;
}

/* Мультимедиа */
figure {
    margin: 32px 0;
    text-align: center;
}
figcaption {
    font-size: 14px;
    color: var(--color-figcaption);
    margin-top: 8px;
}
iframe {
    width: 100%;
    margin: 0 auto;
    display: block;
}

/* Прочее */
hr {
    border: 1px solid var(--color-muted-bg);
    border-style: solid none none;
    margin: 48px 0;
}
summary {
    font-weight: 600;
    color: var(--color-muted);
    cursor: pointer;
}

.cardsAll {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding: 0px 0px 16px 0px;
    scroll-snap-type: x mandatory;
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
}

.cardsAll::-webkit-scrollbar {
    height: 8px;
}
.cardsAll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.card {
    border: 1px solid;
    border-color: transparent;
    /* padding: 16px; */
    border-radius: 8px;
    position: relative;
    width: 450px;
    max-width: calc(100vw - 20%);
    /* aspect-ratio: 100 / 125; */
    /* background: rgb(0 0 0 / 25%); */
    /* background: rgba(200, 200, 200, 0.1); */
    flex: 0 0 auto;
    display: flex;
    scroll-snap-align: center;
    overflow: hidden;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60dvh;
}

.card.add-card {
    background: var(--color-muted-bg);
    background: hsl(0deg 0% 0% / 2.5%);
    /* background: rgba(200, 200, 200, 0.1); */
}

.card img {
    object-fit: cover;
    /* position: absolute; */
    /* z-index: -1; */
    /* width: calc(100% + 32px); */
    /* max-width: max-content !important; */
    /* margin-left: -16px; */
    /* margin-right: -16px; */
    /* margin-top: -16px; */
    width: 100%;
    height: 100%;
    /* max-height: 100%; */
    /* border-radius: 12px; */
}

.card > input {
    position: absolute;
    top: 0;
    left: 0;
}
.card > button.remove-card {
    position: absolute;
    top: 4px;
    left: 4px;
    text-indent: -9999px;
    width: 36.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: transparent;
    backdrop-filter: blur(0px);
}

.card > button.remove-card:before,
.card > button.remove-card:after {
    content: "";
    position: absolute;
    width: 16px;
    height: 2px;
    border-radius: 4px;
    background: var(--color-text);
    transform: rotate(45deg);
}

.card > button.remove-card:after {
    transform: rotate(-45deg);
}

.card > input[type="file"] {
    position: relative;
}

.card-header {
    /* position: absolute; */
    top: 0px;
    width: 100%;
    display: flex;
    /* gap: 16px; */
    /* padding: 16px 16px 4px 4px; */
    justify-content: center;
    align-items: center;
    /* color: white; */
    /* font-size: 14px; */
    height: 50dvh;
    background: var(--color-muted-bg);
    background: hsl(0deg 0% 0% / 2.5%);
    border-radius: 12px;
    overflow: hidden;
}

.card-link-wrapper {
    display: flex;
    flex-direction: column;
}
.card-link-wrapper .link-label,
.card-link-preview {
    background: transparent;
    border: 1px solid;
    border-color: var(--color-muted-bg-dark);
    backdrop-filter: blur(2px);
    padding: 8.9555555px 14px;
    border-radius: 24px;
    text-decoration: none;
    /* color: white; */
    cursor: pointer;
    line-height: 1.15;
    font-size: 14px;
    /* border-radius: 99px; */
    font-weight: 500;
    text-align: center;
    width: max-content;
}
.card-link-wrapper .link-label:hover,
.card-link-preview:hover {
    text-decoration: none;
    background: var(--color-muted-bg-dark);
}
.file-upload-label {
    display: inline-flex;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    /* background: var(--color-muted-bg); */
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    position: absolute;
    /* top: calc(50% - 22px); */
}

.file-upload-label:hover {
    background: var(--color-muted-bg-dark);
}

.file-upload-label::before,
.file-upload-label::after {
    content: "";
    background: var(--color-bg);
    background: var(--color-text);
    width: 24px;
    height: 2px;
    border-radius: 4px;
    pointer-events: none;
    position: absolute;
}
.file-upload-label::before {
    transform: rotate(90deg);
}

.file-upload-label input[type="file"] {
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}

.overlay-div {
    /* background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.1),
        transparent 20%,
        transparent 80%,
        rgba(0, 0, 0, 0.3)
    ); */
    /* position: absolute; */
    /* top: 0; */
    /* left: 0; */
    /* right: 0; */
    /* bottom: 0; */
    /* opacity: 0; */
    /* pointer-events: none; */
}

.card img[style="display: block; max-width: 100%;"] + .overlay-div {
    /* opacity: 1; */
}

.card-footer {
    /* position: absolute; */
    /* bottom: 0px; */
    display: flex;
    gap: 16px;
    flex-direction: row;
    width: 100%;
    padding: 22px 4px 24px 4px;
}

.card input,
.card textarea {
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    font-family:
        ui-sans-serif,
        -apple-system,
        system-ui,
        "Segoe UI",
        Helvetica,
        "Apple Color Emoji",
        Arial,
        sans-serif,
        "Segoe UI Emoji",
        "Segoe UI Symbol";
    font-feature-settings: normal;
    font-variation-settings: normal;
    font-size: 16px;
    line-height: 1.15;
    caret-color: white;
    color: white;
}

.card input::placeholder,
.card textarea::placeholder {
    color: white;
    opacity: 1;
}

.card .link-label.button {
    color: white;
}

.card input:focus,
.card textarea:focus {
    outline: none;
    background: var(--color-muted-bg);
    backdrop-filter: blur(4px);
}

.card-footer input[name="card_footer1_0"] {
    font-weight: 600;
}

form#mainForm input,
form#mainForm textarea {
    color: var(--color-text);
    padding: 0;
    box-shadow: none;
    background: transparent;
    backdrop-filter: none;
}

form#mainForm input[name="name"] {
    font-size: 20px;
    font-weight: 550;
    /* text-transform: uppercase; */
}

form#mainForm input::placeholder,
form#mainForm textarea::placeholder {
    color: var(--color-text);
    opacity: 1;
}

form#mainForm textarea[name="Information"] {
    max-width: 450px;
    font-size: 14px;
    font-family:
        ui-sans-serif,
        -apple-system,
        system-ui,
        "Segoe UI",
        Helvetica,
        "Apple Color Emoji",
        Arial,
        sans-serif,
        "Segoe UI Emoji",
        "Segoe UI Symbol";
    font-feature-settings: normal;
    font-variation-settings: normal;
    font-size: 16px;
    line-height: 1.15;
    color: var(--color-text);
    text-indent: 9ch;
}

label.information span {
    position: absolute;
    font-family:
        ui-sans-serif,
        -apple-system,
        system-ui,
        "Segoe UI",
        Helvetica,
        "Apple Color Emoji",
        Arial,
        sans-serif,
        "Segoe UI Emoji",
        "Segoe UI Symbol";
    font-feature-settings: normal;
    font-variation-settings: normal;
    font-size: 16px;
    line-height: 1.15;
    color: #bcbcbc;
}

.form-main {
    /* border: 1px solid; */
    /* border-color: var(--color-muted-bg-dark); */
    /* border-color: rgba(36, 41, 48, 0.1); */
    /* border-radius: 20px; */
    /* padding: 20px; */
    /* max-width: 350px; */
    display: flex;
    flex-direction: column;
}

.form-footer {
    border: 1px solid;
    border-color: var(--color-muted-bg-dark);
    border-color: transparent;
    border-radius: 20px;
    padding: 20px;
    background: var(--color-muted-bg);
    background: rgba(200, 200, 200, 0.1);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    /* display: none; */
}

.form-main > div:first-child {
    order: 1;
    /* display: block; */
}

.form-main > div:last-child {
    order: 0;
}

.card:first-child {
    margin-left: 16px;
}

.card:last-child {
    margin-right: 16px;
}
[contenteditable="true"]:after {
    content: "✏️";
    /* content: '✎'; */
    transform: scaleX(-1);
    /* transform: scaleX(-1) rotate(20deg); */
    display: inline-block;
}

[name="Information-title"] {
    color: hsl(0deg 0% 0% / 50%);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* border: none; */
}
.modal-content {
    background: #fff;
    /* padding: 1rem; */
    /* border-radius: 8px; */
    /* width: 90%; */
    max-width: 768px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
.close-modal {
    position: absolute;
    top: 0px;
    right: 0px;
    font-size: 35px;
    width: 34px;
    text-align: center;
    cursor: pointer;
    z-index: 9;
    background: red;
}
#extraImagePreview img {
    max-width: 100px;
    margin: 5px;
}

.advanced-toggle-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    font-size: 14px;
    color: rgb(0 0 0 / 50%);
    gap: 8px;
    line-height: 1.25;
    margin-top: 8px;
}

.advanced-toggle-wrapper input {
    width: auto;
    margin-top: 4px;
}

div#modalCard {
    width: 100%;
    margin: 0 !important;
    border-radius: 0;
    border: none;
}

div#modalImageSlider {
    display: flex;
    overflow-x: auto;
    gap: 0;
    padding: 0px 0px 0px 0px;
    scroll-snap-type: x mandatory;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    height: 100%;
}
div#modalCard .card-header {
    border-radius: 0;
}
