@font-face {
    font-family: "encodit Roboto";
    src: url("fonts/roboto-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 750;
    font-display: swap;
}

:is(.edce-admin, .edce-gallery-body, .edce-fields, .edce-upload, .edce-upload-detail) {
    --ink: #29241e;
    --quiet: #625e58;
    --surface: #fff;
    --line: #e9dfd3;
    --accent: #f59d19;
    --accent-hover: #ffb64b;
    --accent-pressed: #ee9210;
    --button-ink: #2b1a04;
    --subtle: #fff7ed;
    --focus: #9f5100;
    --hover-surface: #fff1dd;
    --switch-off: #817970;
    --card-shadow: 0 6px 24px #7137000b;
    --control-radius: 12px;
    --motion: 180ms;
    --ease: cubic-bezier(.2, .75, .3, 1);
    --brand-font: "encodit Roboto", Roboto, "Segoe UI", sans-serif;
}

.edce-gallery-body {
    margin: 0;
    min-height: 100vh;
    background: var(--subtle);
}

.edce-app {
    color: var(--ink);
    font: 15px/1.5 var(--brand-font);
    max-width: 1040px;
}
.edce-app h1, .edce-app h2 { font-family: var(--brand-font); }

.edce-builder-status {
    margin: 4px 0 0;
    font-size: .9em;
    line-height: 1.4;
}
.edce-builder-status:empty { margin: 0; }

.edce-button,
.edce-upload::file-selector-button {
    appearance: none;
    border: 0;
    background: var(--accent);
    color: var(--button-ink);
    border-radius: var(--control-radius);
    font: inherit;
    font-weight: 650;
    padding: 8px 14px;
    min-height: 38px;
    cursor: pointer;
    transition: background-color var(--motion) var(--ease),
        box-shadow var(--motion) var(--ease), transform var(--motion) var(--ease);
}
.edce-button:not(:disabled):hover,
.edce-upload:hover::file-selector-button {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px #a95b0033;
    transform: translateY(-2px);
}
.edce-button:not(:disabled):active,
.edce-upload:active::file-selector-button,
.edce-switch:active {
    background-color: var(--accent-pressed);
    transform: scale(.97);
    box-shadow: none;
}
.edce-button:disabled { opacity: .65; cursor: default; }
.edce-app :focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}
.edce-app :is(.edce-download, .edce-pages a, .edce-delete) {
    transition: background-color var(--motion) var(--ease);
}
.edce-app :is(.edce-download, .edce-pages a, .edce-delete):hover { background-color: var(--hover-surface); }

@media (prefers-reduced-motion: reduce) {
    :is(.edce-admin, .edce-gallery-body, .edce-fields, .edce-upload, .edce-upload-detail) { --motion: 0s; }
    .edce-button:not(:disabled):is(:hover, :active),
    .edce-upload:is(:hover, :active)::file-selector-button,
    .edce-switch:active { transform: none; }
}

.edce-admin {
    padding: clamp(20px, 4vw, 44px);
    margin: 20px 20px 20px 0;
    background: var(--subtle);
    border-radius: 24px;
}
.edce-public { margin: auto; padding: clamp(25px, 6vw, 80px) 20px; }
.edce-app h1, .edce-app h2, .edce-app strong { color: var(--ink); }
.edce-app h1 { font-size: clamp(29px, 5vw, 45px); letter-spacing: -.025em; line-height: 1.15; margin: 20px 0 6px; font-weight: 600; }
.edce-app h2 { font-size: 22px; line-height: 1.2; letter-spacing: -.015em; font-weight: 650; margin: 0 0 14px; }
.edce-logo { width: 145px; height: auto; display: block; }
.edce-header { margin-bottom: 24px; }
.edce-header p, .edce-empty { margin: 0; color: var(--quiet); font-size: 15px; }
.edce-card {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 22px;
    box-shadow: var(--card-shadow);
    padding: clamp(16px, 3vw, 30px);
    margin-bottom: 18px;
}
.edce-row, .edce-entry summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}
.edce-row small, .edce-entry summary span { display: block; color: var(--quiet); font-size: 13px; }
.edce-number { white-space: nowrap; }
.edce-number input { width: 74px; border: 1px solid var(--line); background: var(--subtle); color: var(--ink); border-radius: 9px; }
.edce-format-row, .edce-format-options { flex-wrap: wrap; }
.edce-format-options, .edce-format-options label { display: flex; align-items: center; gap: 8px; }
.edce-format-options { gap: 12px 20px; }
.edce-app .edce-switch {
    appearance: none;
    flex: 0 0 auto;
    cursor: pointer;
    width: 48px;
    height: 28px;
    margin: 0;
    border: 0;
    border-radius: 99px;
    background: var(--switch-off);
    transition: background-color var(--motion) var(--ease), transform var(--motion) var(--ease);
    position: relative;
}
.edce-app .edce-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px #0004;
    transition: transform var(--motion) var(--ease);
}
.edce-app .edce-switch:checked { background: var(--accent); }
.edce-app .edce-switch:checked::before { content: none; }
.edce-app .edce-switch:checked::after { transform: translateX(20px); }
.edce-admin .edce-button { margin-top: 7px; }
.edce-feedback { border-left: 4px solid var(--accent); padding: 10px 14px; margin-bottom: 18px; background: var(--surface); }
.edce-entry summary { cursor: pointer; justify-content: flex-start; }
.edce-entry summary::before { content: '+'; color: var(--quiet); font-size: 20px; width: 1em; }
.edce-entry[open] summary::before { content: '−'; }
.edce-entry summary span { margin-left: auto; text-align: right; }
.edce-contact-detail { display: block; color: var(--quiet); font-weight: 400; overflow-wrap: anywhere; }
.edce-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(158px, 100%), 1fr)); gap: 12px; margin: 0; padding: 0; }
.edce-entry .edce-grid { padding: 0 0 16px; }
.edce-image { margin: 0; min-width: 0; border-radius: 13px; overflow: hidden; border: 1px solid var(--line); background: var(--subtle); }
.edce-preview, .edce-download { display: block; }
.edce-preview img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: block; }
.edce-image-label { margin: 0; overflow-wrap: anywhere; }
.edce-image-label,
.edce-app .edce-download, .edce-app .edce-pages a, .edce-app .edce-delete {
    color: var(--ink);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    min-height: 24px;
    font-size: 13px;
    font-weight: 650;
}
.edce-app :is(.edce-download, .edce-pages a, .edce-delete) {
    text-decoration: underline;
    text-underline-offset: .2em;
}
.edce-image .edce-delete { border-top: 1px solid var(--line); }
.edce-entry-actions { display: flex; padding-block-end: 12px; }
.edce-confirm-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.edce-confirm-actions .edce-button { margin: 0; }
.edce-download span { font-size: 18px; }
.edce-pages { display: flex; border-top: 1px solid var(--line); }
@media (prefers-color-scheme: dark) {
    .edce-gallery-body {
        --ink: #fff7ec;
        --quiet: #ddd2c4;
        --surface: #282520;
        --line: #524337;
        --subtle: #211e19;
        --focus: var(--accent);
        --hover-surface: #3a3024;
    }
}

.edce-fields {
    width: 100%;
    flex-basis: 100%;
    box-sizing: border-box;
}
.edce-fields [hidden], .edce-status:empty { display: none !important; }
.edce-upload::file-selector-button { margin-inline-end: .55rem; }
.edce-status { margin: 0 0 .8rem; }
.edce-privacy { font-size: .9em; margin: 0 0 .8rem; }

.edce-upload { max-width: 100%; }
.edce-upload-button { display: none; }
.edce-upload-button.edce-upload-button-preview,
.edce-js .edce-upload[type=file] + .edce-upload-button { display: inline-block; }
.edce-js input.edce-upload[type=file]:has(+ .edce-upload-button) { display: none; }
.edce-upload-button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.edce-upload-detail {
    display: grid;
    gap: .375rem;
    margin-block-start: .5rem;
    text-align: start;
}
.edce-upload-detail [hidden],
.edce-upload-message:empty { display: none; }
.edce-upload-message { margin: 0; padding: 0; font-weight: 600; }
.edce-upload-area {
    min-block-size: 44px;
    min-inline-size: 0;
    box-sizing: border-box;
    padding-inline: .75rem;
    border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
    border-radius: var(--edce-field-radius, var(--control-radius));
    background: var(--edce-field-background, transparent);
    color: var(--edce-field-color, inherit);
    overflow-wrap: anywhere;
}
.edce-upload-selection {
    display: grid;
    align-content: center;
    min-block-size: 44px;
}
.edce-upload-detail .edce-upload-selection ul {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}
.edce-upload-selection li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .5rem;
    margin: 0;
}
.edce-upload-selection li + li { border-block-start: 1px solid color-mix(in srgb, currentColor 20%, transparent); }
.edce-upload-detail :is(.edce-clear-upload, [data-edce-remove]) {
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: var(--edce-field-radius, var(--control-radius));
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-size: .85em;
    min-height: 44px;
    padding-inline: .375rem;
    text-decoration: underline;
    text-underline-offset: .2em;
    transition: background-color var(--motion) var(--ease);
}
.edce-upload-detail :is(.edce-clear-upload, [data-edce-remove]):hover {
    background: color-mix(in srgb, currentColor 10%, transparent);
}
.edce-upload-detail button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.edce-guide-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px 24px;
}
.edce-guide-nav ul { margin: 0; }
.edce-guide-nav a { color: var(--ink); text-underline-offset: .2em; }
.edce-guide-nav a:hover { color: var(--focus); }
.edce-guide h2 { scroll-margin-block-start: 50px; }
.edce-guide p, .edce-guide li { font-size: inherit; }
.edce-guide figure { margin: 16px 0 0; }
.edce-guide img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--control-radius); }
