/* =========================================================
   DGE — inline page editor
   ========================================================= */

.ie-launcher {
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-family: var(--display);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 18px 40px -18px rgba(11, 13, 18, 0.7);
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.ie-launcher:hover {
    transform: translateY(-1px);
}

.ie-launcher.is-active {
    background: var(--accent);
    color: var(--ink);
    border-color: transparent;
}

.ie-launcher__icon {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    font-size: 13px;
    line-height: 1;
}

.ie-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    z-index: 80;
    margin: 0;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-family: var(--display);
    font-size: 12.5px;
    font-weight: 500;
    box-shadow: 0 18px 40px -18px rgba(11, 13, 18, 0.65);
    transform: translateX(-50%);
}

.ie-toast--error {
    background: #b42318;
}

/* ---------- editable affordances ---------- */

body.ie-on [data-edit] {
    cursor: text;
}

body.ie-on [data-edit-href] {
    cursor: pointer;
}

body.ie-on [data-edit]:hover,
body.ie-on [data-edit-href]:hover {
    outline: 2px dashed color-mix(in srgb, var(--primary) 55%, transparent);
    outline-offset: 3px;
    border-radius: 3px;
}

body.ie-on .ie-target,
body.ie-on .ie-target:hover {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

/* ---------- panel ---------- */

.ie-panel {
    position: fixed;
    right: 22px;
    bottom: 94px;
    z-index: 70;
    width: min(392px, calc(100vw - 32px));
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding: 20px;
    border: 1px solid rgba(11, 13, 18, 0.08);
    border-radius: 18px;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    box-shadow: 0 34px 70px -24px rgba(11, 13, 18, 0.5);
}

.ie-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ie-panel__eyebrow {
    margin: 0;
    font-family: var(--display);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.ie-panel__title {
    margin: 4px 0 0;
    font-family: var(--display);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.ie-panel__close {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.ie-panel__close:hover {
    color: var(--ink);
    border-color: rgba(11, 13, 18, 0.3);
}

.ie-panel__fields {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.ie-field {
    display: grid;
    gap: 6px;
}

.ie-field__label {
    font-family: var(--display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted);
}

.ie-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-family: var(--body);
    font-size: 14px;
    line-height: 1.5;
}

.ie-input:hover {
    border-color: rgba(11, 13, 18, 0.24);
}

.ie-input:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    border-color: transparent;
}

.ie-input--area {
    min-height: 96px;
    resize: vertical;
}

.ie-panel__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.ie-panel__status {
    font-size: 10.5px;
    line-height: 1.5;
    color: var(--muted);
}

.ie-panel__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.ie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    font-family: var(--display);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.ie-btn--primary {
    background: var(--ink);
    color: #fff;
}

.ie-btn--primary:hover {
    background: var(--primary);
}

.ie-btn--primary:disabled {
    opacity: 0.55;
    cursor: progress;
}

.ie-btn--ghost {
    border-color: var(--line);
}

.ie-btn--ghost:hover {
    border-color: rgba(11, 13, 18, 0.3);
}

.ie-btn--quiet {
    color: var(--muted);
}

.ie-btn--quiet:hover {
    color: var(--ink);
}

@media (max-width: 640px) {
    .ie-launcher {
        left: 16px;
        bottom: 16px;
        padding: 10px 14px;
    }

    .ie-panel {
        right: 12px;
        left: 12px;
        bottom: 78px;
        width: auto;
        max-height: calc(100vh - 110px);
    }

    .ie-toast {
        bottom: 78px;
        max-width: calc(100vw - 32px);
    }
}
