/* Edzéstervező — Fociedző diagram editor */

body.diagram-editor-page .site-navbar {
    flex-shrink: 0;
}

body.diagram-editor-page main.flex-grow-1 {
    height: calc(100dvh - var(--navbar-height));
    min-height: 0;
    overflow: hidden;
}

/* 992–1199: a site-menü még desktop, a rajzoló eszköztár mellé már nem fér. */
@media (max-width: 1199.98px) {
    body.diagram-editor-page .navbar-expand-lg .navbar-toggler {
        display: block;
    }

    body.diagram-editor-page .navbar-expand-lg .navbar-collapse:not(.show) {
        display: none !important;
    }

    body.diagram-editor-page .navbar-expand-lg .navbar-collapse.show {
        display: flex !important;
        flex-basis: 100%;
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    body.diagram-editor-page .site-navbar .navbar-nav--main,
    body.diagram-editor-page .site-navbar .navbar-nav--user {
        flex-direction: column;
        margin-left: 0;
        gap: 0.15rem;
    }
}

.de-app {
    --de-sidebar: 248px;
    --de-props: 268px;
    --de-toolbar: 56px;
    --de-tabs: 42px;
    --de-border: rgba(15, 45, 82, 0.08);
    --de-panel: #ffffff;
    position: relative;
    display: grid;
    grid-template-rows: var(--de-toolbar) minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    background: #e8eef3;
    user-select: none;
}

.de-app:has(.de-tabs) {
    grid-template-rows: var(--de-toolbar) var(--de-tabs) minmax(0, 1fr);
}

.de-app[data-workspace="overview"] .de-toolbar__draw-only,
.de-app[data-workspace="details"] .de-toolbar__draw-only {
    display: none !important;
}

.de-app[data-workspace="details"] .de-toolbar__export-group {
    display: none !important;
}

.de-toolbar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.85rem;
    background: var(--de-panel);
    border-bottom: 1px solid var(--de-border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
    z-index: 8;
    min-width: 0;
}

.de-toolbar__brand {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-right: 0.35rem;
    padding-right: 0.85rem;
    border-right: 1px solid var(--de-border);
    flex-shrink: 0;
}

.de-toolbar__eyebrow {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-muted);
    line-height: 1.2;
}

.de-toolbar__title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--color-navy);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.de-toolbar__group {
    display: flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0 0.45rem;
    border-right: 1px solid var(--de-border);
}

.de-toolbar__group:last-of-type {
    border-right: 0;
}

.de-toolbar__spacer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 0.6rem;
}

.de-doc-name {
    display: flex;
    align-items: center;
    min-width: 0;
    width: min(100%, 28rem);
    margin: 0;
}

.de-doc-name__input {
    width: 100%;
    min-width: 0;
    height: 34px;
    margin: 0;
    padding: 0 0.7rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--color-navy);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-align: center;
    outline: none;
    user-select: text;
}

.de-doc-name__input:hover {
    background: #f1f5f9;
}

.de-doc-name__input:focus {
    background: #fff;
    border-color: rgba(15, 45, 82, 0.22);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.de-icon-btn,
.de-toolbar__btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 34px;
    min-width: 34px;
    padding: 0 0.55rem;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--color-navy);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.de-icon-btn:hover,
.de-toolbar__btn:hover {
    background: #f1f5f9;
    border-color: var(--de-border);
}

.de-icon-btn:disabled,
.de-toolbar__btn:disabled {
    opacity: 0.38;
    cursor: default;
    transform: none;
}

.de-toolbar__btn--accent {
    background: var(--color-navy);
    color: #fff;
    border-color: var(--color-navy);
}

.de-toolbar__btn--accent:hover {
    background: var(--color-navy-light);
    border-color: var(--color-navy-light);
    color: #fff;
}

.de-toolbar__btn--green {
    background: var(--color-green);
    color: #fff;
    border-color: var(--color-green);
}

.de-toolbar__btn--green:hover {
    background: var(--color-green-hover);
    border-color: var(--color-green-hover);
    color: #fff;
}

.de-toolbar select.de-input {
    height: 34px;
    width: auto;
    padding: 0 0.5rem;
    font-size: 0.72rem;
}

.de-zoom-label {
    min-width: 3.1rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-muted);
}

.de-body {
    display: grid;
    grid-template-columns: var(--de-sidebar) minmax(0, 1fr) var(--de-props);
    min-height: 0;
    height: 100%;
}

.de-sidebar {
    background: var(--de-panel);
    min-height: 0;
    overflow: auto;
    border-right: 1px solid var(--de-border);
    padding: 0.85rem 0.75rem 1.25rem;
}

.de-props {
    background: var(--de-panel);
    min-height: 0;
    border-left: 1px solid var(--de-border);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.de-props__scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.95rem 0.85rem 0.75rem;
}

.de-section {
    margin-bottom: 1.05rem;
}

.de-section__label {
    display: block;
    margin: 0 0 0.45rem;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.de-section__note {
    margin: 0.4rem 0 0;
    font-size: 0.68rem;
    color: var(--color-muted);
    line-height: 1.4;
}

.de-tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.de-tool-grid--colors {
    grid-template-columns: repeat(3, 1fr);
}

.de-tool-grid--pitch {
    grid-template-columns: 1fr 1fr;
}

.de-pitch-custom {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    align-items: center;
    gap: 0.28rem;
    margin: 0.2rem 0 0.35rem;
    padding: 0.28rem;
    border: 1px solid transparent;
    border-radius: 10px;
}

.de-pitch-custom.is-active {
    border-color: var(--color-accent);
    background: #ecfdf5;
}

.de-pitch-custom .de-input {
    height: 32px;
    padding: 0 0.4rem;
    font-size: 0.78rem;
    text-align: center;
}

.de-pitch-custom__x {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--color-muted);
}

.de-tool-grid--sizes {
    grid-template-columns: repeat(4, 1fr);
}

.de-tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    min-height: 58px;
    padding: 0.45rem 0.3rem 0.4rem;
    border: 1px solid #e8eef3;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.de-tool:hover {
    background: #fff;
    border-color: #c5ddd0;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 45, 82, 0.06);
}

.de-tool.is-active {
    background: #ecfdf5;
    border-color: var(--color-accent);
    color: var(--color-green);
    box-shadow: 0 0 0 3px rgba(60, 179, 113, 0.16);
}

.de-tool svg,
.de-tool__glyph {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.de-tool--wide {
    grid-column: 1 / -1;
    flex-direction: row;
    min-height: 40px;
    gap: 0.4rem;
}

.de-tool[data-action="autonumber"] {
    width: 100%;
    background: #ecfdf5;
    border-color: #b7e4c7;
    color: var(--color-green);
}

.de-tool--sm {
    min-height: 40px;
    padding: 0.35rem 0.2rem;
    font-size: 0.64rem;
}

.de-tool--sm svg {
    width: 16px;
    height: 16px;
}

.de-player-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(15, 45, 82, 0.28);
}

.de-player-dot--gk {
    border-radius: 5px;
}

.de-player-dot--coach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
}

.de-player-dot--joker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: repeating-linear-gradient(
        40deg,
        #f8fafc 0 3px,
        #2563eb 3px 6px
    );
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 0 2px #1e3a8a, 0 0 2px #1e3a8a;
}

.de-size-row__label {
    margin: 0.55rem 0 0.28rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.de-size-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}

.de-size-row__btn {
    min-height: 34px;
    padding: 0.3rem 0.25rem;
    border: 1px solid #e8eef3;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
}

.de-size-row__btn:hover {
    background: #fff;
    border-color: #c5ddd0;
}

.de-size-row__btn.is-active {
    background: #ecfdf5;
    border-color: var(--color-accent);
    color: var(--color-green);
    box-shadow: 0 0 0 3px rgba(60, 179, 113, 0.16);
}

.de-stage-wrap {
    position: relative;
    min-width: 0;
    min-height: 0;
    container-type: inline-size;
    container-name: de-stage;
    background:
        radial-gradient(circle at 1px 1px, rgba(15, 45, 82, 0.055) 1px, transparent 0);
    background-color: #dfe8ef;
    background-size: 20px 20px;
}

#de-stage {
    position: absolute;
    inset: 0;
    touch-action: none;
}

.de-marquee-band {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 6;
    pointer-events: none;
    box-sizing: border-box;
    border: 1px solid #0078d7;
    background: rgba(0, 120, 215, 0.22);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.92);
    will-change: transform, width, height;
}

.de-marquee-band[hidden] {
    display: none !important;
}

#de-stage canvas {
    border-radius: 0;
}

.de-tip[hidden],
.de-restore[hidden] {
    display: none !important;
}

.de-tip,
.de-restore {
    position: absolute;
    left: 50%;
    top: 16px;
    transform: translateX(-50%);
    z-index: 8;
    max-width: min(520px, calc(100% - 32px));
    padding: 0.7rem 0.85rem;
    background: rgba(15, 45, 82, 0.92);
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 45, 82, 0.18);
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: none;
}

.de-tip *,
.de-restore * {
    pointer-events: none;
}

.de-tip p,
.de-restore p {
    margin: 0;
    line-height: 1.35;
}

.de-tip button,
.de-restore button {
    flex-shrink: 0;
    border: 0;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-radius: 8px;
    padding: 0.28rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    pointer-events: auto;
}

.de-restore {
    top: 62px;
    background: #fff;
    color: var(--color-navy);
    border: 1px solid var(--de-border);
}

.de-restore button.de-restore__load {
    background: var(--color-green);
    color: #fff;
}

.de-restore button.de-restore__dismiss {
    background: #f1f5f9;
    color: var(--color-navy);
}

.de-mode-badge[hidden] {
    display: none !important;
}

.de-mode-badge {
    --de-badge-size: clamp(0.92rem, 0.75rem + 0.55vw, 1.22rem);
    --de-badge-size: clamp(0.92rem, 0.62rem + 1.35cqi, 1.22rem);
    position: absolute;
    top: clamp(8px, 1.2cqi, 14px);
    right: clamp(8px, 1.2cqi, 14px);
    z-index: 9;
    display: flex;
    align-items: center;
    gap: clamp(0.4rem, 0.25rem + 0.7cqi, 0.7rem);
    max-width: min(28rem, calc(100% - 24px));
    padding: 0.28em 0.28em 0.28em 0.85em;
    background: rgba(15, 45, 82, 0.92);
    color: #fff;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(15, 45, 82, 0.22);
    font-size: var(--de-badge-size);
    line-height: 1.2;
}

.de-mode-badge__name {
    font-size: 1.08em;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.de-mode-badge__exit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.32em;
    margin: 0;
    border: 0;
    border-radius: 999px;
    padding: 0.32em 0.62em;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font: inherit;
    font-size: 0.78em;
    font-weight: 700;
    cursor: pointer;
}

.de-mode-badge__exit:hover {
    background: rgba(255, 255, 255, 0.22);
}

.de-mode-badge kbd {
    display: inline-block;
    padding: 0.06em 0.32em;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    font-family: inherit;
    font-size: 0.92em;
    font-weight: 800;
}

@container de-stage (max-width: 640px) {
    .de-mode-badge {
        --de-badge-size: clamp(0.84rem, 0.7rem + 1.1cqi, 1.02rem);
        max-width: calc(100% - 16px);
    }
}

@container de-stage (max-width: 480px) {
    .de-mode-badge__exit span {
        display: none;
    }
}

.de-toast {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%) translateY(12px);
    z-index: 90;
    padding: 0.55rem 0.9rem;
    background: var(--color-navy);
    color: #fff;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 8px 24px rgba(15, 45, 82, 0.2);
}

.de-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.de-keys {
    flex-shrink: 0;
    margin: 0.55rem 0.75rem 0.8rem;
    padding: 0;
    background: #eafaf1;
    border: 1px solid #2d6a4f;
    border-radius: 12px;
}

.de-keys__summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 38px;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
    user-select: none;
}

.de-keys__summary::-webkit-details-marker {
    display: none;
}

.de-keys__summary::after {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid #1f6b4f;
    border-bottom: 2px solid #1f6b4f;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.de-keys[open] .de-keys__summary::after {
    transform: rotate(225deg);
    margin-top: 0.2rem;
}

.de-keys[open] .de-keys__summary {
    border-bottom: 1px solid rgba(45, 106, 79, 0.22);
}

.de-keys__label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #1f6b4f;
}

.de-keys__list {
    margin: 0;
    padding: 0.55rem 0.8rem 0.75rem;
    list-style: none;
}

.de-keys__list li {
    margin: 0 0 0.28rem;
    font-size: 0.74rem;
    line-height: 1.4;
    color: #0f2d52;
}

.de-keys__list li:last-child {
    margin-bottom: 0;
}

.de-keys kbd {
    display: inline-block;
    padding: 0.05rem 0.32rem;
    border: 1px solid #b7d8c6;
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    color: #1f6b4f;
}

.de-toast--warn {
    background: #9a3412;
}

#de-text-editor-host {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.de-inline-text {
    position: absolute;
    pointer-events: auto;
    border: 2px solid #3cb371;
    border-radius: 6px;
    background: rgba(15, 45, 82, 0.72);
    color: #fff;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 700;
    padding: 2px 6px;
    outline: none;
    min-width: 80px;
}

.de-props__title {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--color-navy);
    letter-spacing: -0.02em;
}

.de-props__kind {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-green);
}

.de-props__lead {
    margin: 0 0 0.4rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-navy);
}

.de-props__hint {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    color: var(--color-muted);
    line-height: 1.45;
}

.de-props__steps {
    margin: 0 0 1.1rem;
    padding-left: 1.15rem;
    color: var(--color-text);
    font-size: 0.8rem;
    line-height: 1.7;
}

.de-field {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    margin-bottom: 0.75rem;
}

.de-field__label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--color-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.de-input {
    width: 100%;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 0 0.65rem;
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--color-text);
    background: #f8fafc;
}

.de-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(60, 179, 113, 0.18);
    background: #fff;
}

.de-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.de-range input {
    flex: 1;
    accent-color: var(--color-green);
}

.de-range__val {
    min-width: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-navy);
    text-align: right;
}

.de-dir {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
}

.de-dir__btn {
    min-height: 36px;
    padding: 0.35rem 0.4rem;
    border: 1px solid #e8eef3;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.de-dir__btn:hover {
    background: #fff;
    border-color: #c5ddd0;
}

.de-dir__btn.is-active {
    background: #ecfdf5;
    border-color: var(--color-accent);
    color: var(--color-green);
    box-shadow: 0 0 0 3px rgba(60, 179, 113, 0.16);
}

.de-action-btn {
    width: 100%;
    min-height: 38px;
    padding: 0.4rem 0.6rem;
    border: 1px solid #c5ddd0;
    border-radius: 10px;
    background: #ecfdf5;
    color: var(--color-green);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.de-action-btn:hover {
    background: #d1fae5;
}

.de-swatches {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.de-swatches--tools {
    margin: 0;
}

.de-swatches--tools .de-swatch {
    width: 26px;
    height: 26px;
}

.de-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(15, 45, 82, 0.18);
    padding: 0;
    cursor: pointer;
}

.de-swatch.is-active {
    box-shadow: 0 0 0 2px #3cb371, 0 0 0 1px rgba(15, 45, 82, 0.18);
}

.de-swatch--light {
    box-shadow: 0 0 0 1px rgba(15, 45, 82, 0.28);
}

.de-swatch--light.is-active {
    box-shadow: 0 0 0 2px #3cb371, 0 0 0 1px rgba(15, 45, 82, 0.28);
}

.de-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-navy);
    margin-bottom: 0.75rem;
}

.de-layers {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--de-border);
}

.de-layers__title {
    margin: 0 0 0.5rem;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.de-layers__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
}

.de-layers__btn {
    height: 32px;
    border: 1px solid #e8eef3;
    border-radius: 8px;
    background: #f8fafc;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-navy);
    cursor: pointer;
}

.de-rotate {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
}

.de-rotate__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 34px;
    border: 1px solid #e8eef3;
    border-radius: 8px;
    background: #f8fafc;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-navy);
    cursor: pointer;
}

.de-rotate__btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.de-rotate__btn:hover {
    background: #eef7f2;
    border-color: #cfe5d8;
}

.de-layers__btn:hover:not(:disabled) {
    border-color: #c5ddd0;
    background: #fff;
}

.de-layers__btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.de-help {
    margin-top: 0.4rem;
    padding: 0.7rem 0.75rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #eef2f6;
}

.de-help p {
    margin: 0;
    font-size: 0.72rem;
    color: var(--color-muted);
    line-height: 1.45;
}

.de-disclosure {
    margin: 0 0 1.05rem;
    border: 1px solid #e8eef3;
    border-radius: 12px;
    background: #f8fafc;
    padding: 0.15rem 0.55rem 0.55rem;
}

.de-disclosure > summary {
    cursor: pointer;
    list-style: none;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-navy);
    padding: 0.55rem 0.2rem;
}

.de-disclosure > summary::-webkit-details-marker {
    display: none;
}

.de-disclosure > summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 0.35rem;
    color: var(--color-green);
}

.de-disclosure[open] > summary::before {
    content: "▾";
}

.de-disclosure .de-section__label {
    margin-top: 0.65rem;
}

.de-disclosure .de-tool-grid {
    margin-top: 0.2rem;
}

.de-inventory {
    margin: 0 0 1rem;
    padding: 0 0 0.85rem;
    border-bottom: 1px solid var(--de-border, #e8eef3);
}

.de-inventory .de-props__title {
    margin-bottom: 0.45rem;
}

.de-inventory__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.de-inventory__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.22rem 0;
    font-size: 0.78rem;
    color: var(--color-text);
    border-bottom: 1px solid #f1f5f9;
}

.de-inventory__item:last-child {
    border-bottom: 0;
}

.de-inventory__n {
    font-variant-numeric: tabular-nums;
    color: var(--color-navy);
}

.de-mobile-note {
    display: none;
}

.de-device-gate {
    display: none;
}

.de-drawer-btn {
    display: none;
}

@media (max-width: 1280px) {
    .de-app {
        --de-sidebar: 212px;
        --de-props: 228px;
        --de-toolbar: 48px;
    }

    .de-toolbar {
        gap: 0.16rem;
        padding: 0 0.4rem;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .de-toolbar__brand {
        display: none;
    }

    .de-toolbar__group {
        padding: 0 0.22rem;
        gap: 0.12rem;
        flex-shrink: 0;
    }

    .de-toolbar__spacer {
        padding: 0 0.3rem;
        flex: 1 1 7rem;
    }

    .de-doc-name {
        width: min(100%, 14rem);
    }

    .de-icon-btn,
    .de-toolbar__btn {
        height: 32px;
        min-width: 32px;
        padding: 0 0.4rem;
    }

    .de-toolbar select.de-input {
        height: 32px;
    }

    #de-export-quality {
        display: none;
    }

    .de-toolbar__export-group .de-toolbar__btn span {
        display: none;
    }
}

@media (max-width: 1100px) {
    .de-toolbar__btn[data-action="copy-image"] {
        display: none;
    }

    .de-toolbar__btn[data-action="new"] {
        min-width: 0;
        padding: 0 0.45rem;
    }
}

@media (max-width: 899px) {
    .de-app {
        --de-sidebar: 0px;
        --de-props: 0px;
    }

    .de-body {
        grid-template-columns: minmax(0, 1fr);
        position: relative;
    }

    .de-sidebar,
    .de-props {
        position: absolute;
        top: 0;
        bottom: 0;
        z-index: 8;
        width: min(280px, 86vw);
        box-shadow: 0 12px 40px rgba(15, 45, 82, 0.16);
        transform: translateX(-110%);
        transition: transform 0.22s ease;
    }

    .de-props {
        right: 0;
        left: auto;
        transform: translateX(110%);
    }

    .de-sidebar.is-open,
    .de-props.is-open {
        transform: translateX(0);
    }

    .de-drawer-btn {
        display: inline-flex;
    }
}

@media (max-width: 720px) {
    .de-toolbar__title,
    .de-toolbar__eyebrow {
        display: none;
    }

    .de-doc-name__input {
        font-size: 0.8rem;
        text-align: left;
        padding: 0 0.45rem;
    }

    .de-toolbar__btn span {
        display: none;
    }
}

/* Fekvő telefon: site-navbar le, fiókos panelek, alacsony sávok. */
html.de-editor-phone-land body.diagram-editor-page .site-navbar {
    display: none;
}

html.de-editor-phone-land body.diagram-editor-page main.flex-grow-1 {
    height: 100dvh;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

html.de-editor-phone-land .de-app {
    --de-sidebar: 0px;
    --de-props: 0px;
    --de-toolbar: 40px;
    --de-tabs: 30px;
}

html.de-editor-phone-land .de-body {
    grid-template-columns: minmax(0, 1fr);
    position: relative;
}

html.de-editor-phone-land .de-sidebar,
html.de-editor-phone-land .de-props {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 8;
    width: min(280px, 78vw);
    box-shadow: 0 12px 40px rgba(15, 45, 82, 0.16);
    transform: translateX(-110%);
}

html.de-editor-phone-land .de-props {
    right: 0;
    left: auto;
    transform: translateX(110%);
}

html.de-editor-phone-land .de-sidebar.is-open,
html.de-editor-phone-land .de-props.is-open {
    transform: translateX(0);
}

html.de-editor-phone-land .de-drawer-btn {
    display: inline-flex;
}

html.de-editor-phone-land .de-toolbar {
    gap: 0.1rem;
    padding: 0 0.28rem;
}

html.de-editor-phone-land .de-toolbar__btn[data-action="new"],
html.de-editor-phone-land .de-toolbar__btn[data-action="load"],
html.de-editor-phone-land .de-zoom-label,
html.de-editor-phone-land .de-tip,
html.de-editor-phone-land .de-keys {
    display: none !important;
}

html.de-editor-phone-land .de-toolbar__btn {
    height: 30px;
    min-width: 30px;
    font-size: 0.7rem;
    padding: 0 0.38rem;
}

html.de-editor-phone-land .de-icon-btn {
    height: 30px;
    min-width: 30px;
}

html.de-editor-phone-land .de-tabs__btn {
    padding: 0 0.55rem;
    font-size: 0.72rem;
}

html.de-editor-phone-land .de-doc-name {
    width: min(100%, 8.5rem);
}

.de-icon-btn svg,
.de-toolbar__btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.de-toolbar__brand {
    text-decoration: none;
    color: inherit;
}

.de-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4.5rem 1rem 1.5rem;
    user-select: text;
}

.de-modal[hidden] {
    display: none !important;
    pointer-events: none !important;
}

.de-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 45, 82, 0.38);
}

.de-modal__panel {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: calc(100% - 0.5rem);
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 45, 82, 0.22);
    padding: 1.15rem 1.2rem 1.2rem;
}

.de-modal__title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-navy);
    margin: 0 0 0.45rem;
}

.de-modal__lead {
    margin: 0 0 1rem;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.45;
}

.de-save-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
}

.de-save-field input,
.de-save-field textarea,
.de-save-field select {
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid rgba(15, 45, 82, 0.14);
    border-radius: 10px;
    padding: 0.45rem 0.65rem;
    color: #0f2d52;
}

.de-save-field input.is-invalid,
.de-save-field textarea.is-invalid,
.de-save-field select.is-invalid {
    border-color: #b42318;
    background: #fff5f4;
}

.de-save-field__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.de-from-diagram {
    appearance: none;
    border: 0;
    background: rgba(31, 107, 79, 0.12);
    color: #1f6b4f;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    cursor: pointer;
}

.de-from-diagram:hover,
.de-from-diagram:focus-visible {
    background: #1f6b4f;
    color: #fff;
}

.de-save-hint {
    font-weight: 500;
    font-size: 0.72rem;
    color: #64748b;
}

.de-save-ages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.de-save-ages label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 45, 82, 0.12);
    background: #f8fafc;
}

.de-save-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.de-save-error {
    color: #b42318;
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.de-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.35rem;
}

.de-modal__actions a {
    text-decoration: none;
}

[data-rename-old],
[data-rename-new] {
    font-weight: 800;
    color: var(--color-navy);
    word-break: break-word;
}

.de-tool,
.de-icon-btn,
.de-toolbar__btn,
.de-layers__btn,
.de-rotate__btn,
.de-swatch {
    appearance: none;
    -webkit-appearance: none;
}

.de-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0 0.85rem;
    background: var(--de-panel);
    border-bottom: 1px solid var(--de-border);
    min-width: 0;
}

.de-tabs__btn {
    appearance: none;
    border: 0;
    background: transparent;
    margin: 0;
    padding: 0 1rem;
    height: var(--de-tabs);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.de-tabs__btn:hover {
    color: var(--color-navy);
}

.de-tabs__btn.is-active {
    color: var(--color-navy);
    border-bottom-color: #1f6b4f;
}

.de-tabs__btn.has-attention {
    color: #b42318;
    box-shadow: inset 0 -2px 0 #b42318;
}

.de-tabs__btn.has-attention.is-active {
    border-bottom-color: #b42318;
}

.de-workspace {
    min-height: 0;
    height: 100%;
    overflow: hidden;
    display: grid;
}

.de-pane {
    min-height: 0;
    height: 100%;
}

.de-pane[hidden] {
    display: none !important;
}

.de-pane--draw {
    overflow: hidden;
    display: grid;
}

.de-pane--overview,
.de-pane--details {
    overflow: auto;
    user-select: text;
    background: #f3f6f9;
    padding: 1.1rem 1.15rem 1.5rem;
}

.de-sheet {
    width: min(1100px, 100%);
    margin: 0 auto;
    background: #fff;
    border: 1px solid rgba(15, 45, 82, 0.16);
}

.de-sheet__head {
    border-bottom: 1px solid rgba(15, 45, 82, 0.16);
    padding: 0.7rem 1rem;
}

.de-sheet__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-navy);
    line-height: 1.3;
}

.de-sheet__body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 0.8fr);
    min-height: 280px;
}

.de-sheet__visual {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 1px solid rgba(15, 45, 82, 0.16);
}

.de-sheet__figure {
    background: #0f2d52;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 0.6rem;
}

.de-sheet__figure img {
    display: block;
    max-width: 100%;
    max-height: min(62vh, 560px);
    height: auto;
    background: #0f2d52;
}

.de-sheet__empty {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
}

.de-sheet__facts {
    min-width: 0;
    padding: 0.7rem 0.85rem 0.9rem;
}

.de-sheet__facts-label {
    margin: 0 0 0.45rem;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #64748b;
}

.de-sheet__desc {
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--color-navy);
}

.de-sheet__desc p {
    margin: 0 0 0.45em;
}

.de-sheet__desc p:last-child {
    margin-bottom: 0;
}

.de-sheet__desc ul,
.de-sheet__desc ol {
    margin: 0.2em 0 0.45em;
    padding-left: 1.2em;
}

.de-sheet__stats {
    list-style: none;
    margin: 0;
    padding: 0.65rem 0.55rem 0.75rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    border-top: 1px solid rgba(15, 45, 82, 0.16);
    background: #d9e3ef;
}

.de-stat {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
    padding: 0.5rem 0.6rem 0.55rem;
    border: 0;
    border-left: 3px solid transparent;
}

.de-stat--players {
    background: #dce6f4;
    border-left-color: #0f2d52;
}

.de-stat--gk {
    background: #d7eee4;
    border-left-color: #1f6b4f;
}

.de-stat--age {
    background: #e4e0f2;
    border-left-color: #5b4d8a;
}

.de-stat--pitch {
    background: #dcefd6;
    border-left-color: #3cb371;
}

.de-stat--equip {
    grid-column: 1 / -1;
    background: #efe6d4;
    border-left-color: #b45309;
}

.de-stat__value {
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--color-navy);
    line-height: 1.3;
}

.de-stat__label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: inherit;
    opacity: 0.72;
}

.de-stat--players .de-stat__label { color: #0f2d52; opacity: 1; }
.de-stat--gk .de-stat__label { color: #1f6b4f; opacity: 1; }
.de-stat--age .de-stat__label { color: #5b4d8a; opacity: 1; }
.de-stat--pitch .de-stat__label { color: #1f6b4f; opacity: 1; }
.de-stat--equip .de-stat__label { color: #9a3412; opacity: 1; }

.de-stat__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.de-stat__chip {
    display: inline-block;
    padding: 0.18rem 0.5rem;
    background: rgba(255, 255, 255, 0.55);
    color: #7c2d12;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
}

.de-sheet.is-exporting .de-sheet__figure img {
    max-height: none;
}

.de-details-form {
    width: min(760px, 100%);
    margin: 0 auto;
    background: #fff;
    border: 1px solid rgba(15, 45, 82, 0.12);
    padding: 1.15rem 1.2rem 1.35rem;
}

.de-details-form__title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-navy);
}

.de-details-form__lead {
    margin: 0 0 1rem;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.45;
}

.de-details-form .rich-editor {
    user-select: text;
}

.de-details-form .ql-toolbar button,
.de-details-form .ql-toolbar .ql-picker {
    pointer-events: auto;
}

@media (max-width: 860px) {
    .de-sheet__body {
        grid-template-columns: 1fr;
    }

    .de-sheet__visual {
        border-right: 0;
        border-bottom: 1px solid rgba(15, 45, 82, 0.16);
    }

    .de-sheet__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.de-device-gate__link {
    display: inline-flex;
    margin-top: 1.15rem;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    background: #fff;
    color: #0f2d52;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
}

.de-device-gate__link:hover,
.de-device-gate__link:focus-visible {
    background: #ecfdf5;
}

html.de-editor-blocked body.diagram-editor-page main.flex-grow-1 {
    height: auto;
    min-height: calc(100dvh - var(--navbar-height));
    overflow: auto;
}

html.de-editor-blocked .de-app,
html.de-editor-blocked .de-modal {
    display: none !important;
}

html.de-editor-blocked .de-device-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100dvh - var(--navbar-height));
    padding: 1.5rem 1.15rem 2.5rem;
    background: #0f2d52;
    color: #fff;
}

@media (orientation: portrait) and (max-width: 700px) {
    html:not(.de-editor-allowed) body.diagram-editor-page main.flex-grow-1 {
        height: auto;
        min-height: calc(100dvh - var(--navbar-height));
        overflow: auto;
    }

    html:not(.de-editor-allowed) .de-app,
    html:not(.de-editor-allowed) .de-modal {
        display: none !important;
    }

    html:not(.de-editor-allowed) .de-device-gate {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: calc(100dvh - var(--navbar-height));
        padding: 1.5rem 1.15rem 2.5rem;
        background: #0f2d52;
        color: #fff;
    }
}

.de-device-gate__card {
    width: min(26rem, 100%);
    text-align: center;
}

.de-device-gate__kicker {
    margin: 0 0 0.45rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.de-device-gate__title {
    margin: 0 0 0.7rem;
    font-size: 1.45rem;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.de-device-gate__text {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
}
