.st { display: grid; gap: var(--s4); }
.st-flow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); min-height: 32px; }
/* 섹션이 없을 때는 빈 줄이 자리를 차지하지 않게 한다 */
.st-flow:empty { display: none; }
.st-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.st-add { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.st-chip { cursor: grab; }
.st-chip:not(.badge--hue) { color: var(--tx); }
.st-chip[aria-pressed="true"] { outline: 2px solid var(--sky-a); outline-offset: 2px; }
.st-plus { cursor: pointer; border: 0; }

/* 글 칸 하나. 섹션은 칸 안의 형광펜 하이라이트다. 칸 포커스는 테두리 색만 바꾼다 */
.ed {
    position: relative;
    --gutter: 56px;
    border: 1px solid var(--bd);
    border-radius: var(--r-card);
    background: var(--sf);
    transition: border-color var(--fx) var(--ease-fx);
}
.ed:focus-within { border-color: var(--sky-a); }
.ed-back, .ed-text, .ed-mirror {
    box-sizing: border-box;
    margin: 0;
    padding: var(--s4) var(--s4) var(--s4) var(--gutter);
    font: 400 15px/24px var(--font-sans);
    letter-spacing: -.01em;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
}
.ed-back, .ed-mirror { position: absolute; inset: 0; color: transparent; pointer-events: none; overflow: hidden; }
.ed-mirror { visibility: hidden; }
.ed-gap { height: 24px; }
/* 섹션 줄 뒤 배경(형광펜). 글 위치는 음수 여백과 안쪽 여백으로 그대로 둔다 */
.ed-block { margin-inline: -4px; padding-inline: 4px; border-radius: 2px; }
.ed-block[data-hue] { background: var(--hue-soft); }
.ed-block.is-join { box-shadow: inset 0 2px 0 var(--hue); }
.ed-block.is-selected { outline: 1px solid var(--sky-a); }
.ed-text {
    position: relative;
    display: block;
    width: 100%;
    min-height: 240px;
    border: 0;
    border-radius: var(--r-card);
    background: transparent;
    color: var(--tx);
    resize: none;
    overflow: hidden;
    outline: none;
}

/* 섹션 이름표: 첫 줄 왼쪽 안쪽 여백에 글자로 붙는다. 누르면 메뉴 */
.ed-tags { position: absolute; inset: 0; pointer-events: none; }
.st-tag {
    position: absolute;
    left: 6px;
    height: 24px;
    margin: 0;
    padding: 0 2px;
    border: 0;
    background: none;
    color: var(--hue-tx, var(--tx-2));
    font: 600 12px/24px var(--font-sans);
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
}
.st-tag::after, .st-opt::after {
    content: '';
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 2px;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--fx) var(--ease-fx);
}
.st-tag:hover::after, .st-tag:focus-visible::after, .st-tag[aria-expanded="true"]::after { transform: scaleX(1); }
.st-tag:focus-visible { outline: none; }

.st-menu {
    position: absolute;
    left: 6px;
    z-index: 6;
    display: grid;
    gap: var(--s2);
    min-width: 168px;
    padding: var(--s2);
    background: var(--sf);
    border: 1px solid var(--bd);
    border-radius: var(--r-ctl);
    box-shadow: 0 6px 18px rgb(0 0 0 / .16);
}
.st-menu[hidden], .st-bar[hidden] { display: none; }
.st-opts { display: grid; }
.st-opt {
    position: relative;
    padding: var(--s1) var(--s2);
    margin: 0;
    border: 0;
    background: none;
    color: var(--tx);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}
.st-opt[aria-pressed="true"]::after, .st-opt:hover::after, .st-opt:focus-visible::after { transform: scaleX(1); }
.st-opt:focus-visible { outline: none; }
.st-acts { display: flex; justify-content: space-between; padding-top: var(--s2); border-top: 1px solid var(--bd); }

/* 고른 글 위에 뜨는 종류 막대. 640 미만은 화면 아래에 고정된다(JS가 .wz-nav 바로 위에 맞춘다) */
.st-bar {
    position: absolute;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: var(--s1);
    padding: var(--s1);
    background: var(--sf);
    border: 1px solid var(--bd);
    border-radius: var(--r-ctl);
    box-shadow: 0 6px 18px rgb(0 0 0 / .16);
}
.st-bar.is-fixed {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    justify-content: space-around;
    border-width: 1px 0 0;
    border-radius: 0;
    box-shadow: none;
    padding: var(--s2) var(--s3);
}
.st-pick {
    min-width: 36px;
    height: 32px;
    padding: 0 var(--s2);
    margin: 0;
    border: 0;
    border-radius: var(--r-xs);
    background: var(--hue-soft);
    color: var(--hue-tx);
    font: 600 13px/1 var(--font-sans);
    cursor: pointer;
}
.st-pick.st-erase { display: inline-flex; align-items: center; justify-content: center; background: none; color: var(--tx-2); }

@media (max-width: 639.98px) {
    .ed-back, .ed-text, .ed-mirror { font-size: 16px; }   /* JDS가 모바일 입력 글자를 16px로 강제한다 */
    .st-tag { left: 4px; }
    /* 640 미만 아래 고정 종류 막대: 누르는 칸 40px, 알림은 막대 위로 띄운다 */
    .st-bar.is-fixed .st-pick { height: 40px; min-width: 44px; }
}
body:has(.st-bar.is-fixed:not([hidden])) .toast { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 64px); }
body:has(.wz-nav):has(.st-bar.is-fixed:not([hidden])) .toast { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 136px); }
