/*
 * ══ 본문 글꼴 — 언어마다 맨 앞 글꼴만 갈아 끼운다 (2026-10-27, docs/I18N_MULTILANGUAGE.md 0-F) ══
 *
 * 한·중·일은 같은 한자 코드(Han unification)를 쓰지만 글자 모양이 나라마다 다르다. 한국어 글꼴로
 * 일본어를 그리면 「直」「骨」 같은 글자가 일본 사람 눈에 틀린 모양으로 보인다. 그래서 :lang() 으로
 * 그 언어의 글꼴을 맨 앞에 둔다. 요소에 lang 을 달면(언어 고르기의 「日本語」) 그 요소만 바뀐다.
 *
 * ★ Mantine 테마의 fontFamily 도 이 변수를 쓴다(utils/theme/ThemeProvider.tsx · utils/styles/theme.ts) —
 *   Mantine 은 부품마다 font-family 를 직접 박으므로 html 만 바꾸면 부품은 안 바뀐다.
 * ★ 웹폰트(Noto Sans JP·SC·TC·Thai)는 _document 의 Google Fonts 요청에 있다. Google 이 unicode-range 로
 *   잘라 주고, 이 스택에 그 글꼴이 오르는 언어에서만 받아진다 — 한국어·영어 화면은 받지 않는다.
 * ★ 한국어·기본 스택은 종전 값 그대로다.
 */
/* :lang(ko) 도 같은 값 — 다른 언어 화면 안의 「한국어」(lang="ko") 가 그 언어 스택을 물려받지 않게. */
:root,
:lang(ko) {
  --grablo-font-sans: 'Noto Sans CJK KR', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
    Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
}
:lang(ja) {
  --grablo-font-sans: 'Noto Sans JP', 'Noto Sans CJK JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI',
    'Yu Gothic', Meiryo, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue,
    Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
}
:lang(zh-Hans) {
  --grablo-font-sans: 'Noto Sans SC', 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji,
    Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
}
:lang(zh-Hant) {
  --grablo-font-sans: 'Noto Sans TC', 'Noto Sans CJK TC', 'PingFang TC', 'Microsoft JhengHei', ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji,
    Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
}
:lang(th) {
  --grablo-font-sans: 'Noto Sans Thai', 'Leelawadee UI', Thonburi, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji,
    Segoe UI Symbol, Noto Color Emoji;
}

/*
 * ══ 줄바꿈 — 언어마다 한 곳에서 정한다 (2026-11-22, litmus-qa D-316·D-W045) ══
 *
 * 한국어는 낱말을 띄어 쓰므로 **어절 단위**로 꺾는다(keep-all). 종전에는 화면마다 keep-all 을 따로 달아
 *   ① 달지 않은 화면(로컬 화면 첫 화면 LocalShell)은 「…있습니」 / 「다.」로 낱말 한가운데가 끊겼고(D-316)
 *   ② 단 화면은 일본어·중국어에도 걸려 문장부호에서만 줄이 바뀌고 끝 글자 「す。」만 다음 줄로 갔다(D-W045).
 * ja·zh 는 글자 사이에서 꺾는 것이 정상 조판이다 — 금칙(line-break: strict)과 끝 줄 한두 글자 방지
 * (text-wrap-style: pretty)만 준다. pretty 는 **style 롱핸드**로 준다 — 단축형 text-wrap 은 wrap 모드까지
 * 바꿔 부모의 white-space: nowrap 을 풀어 버린다.
 * ★ 부품이 keep-all 을 따로 주어야 하면(포털로 html 밖 상속이 끊기는 것은 아니지만 부모가 normal 을 준 경우)
 *   `word-break: var(--grablo-word-break)` 로 쓴다 — 언어 갈래가 이 한 곳에 남는다.
 * ★ overflow-wrap: break-word — 띄어쓰기 없는 긴 낱말(주소·이름)은 넘칠 때만 꺾는다. min-content 폭은 바꾸지 않는다
 *   (anywhere 와 다르다 — 전역에 두어도 flex·표 칸의 최소 폭이 줄지 않는다).
 */
:root { --grablo-word-break: normal; }
:root:lang(ko) { --grablo-word-break: keep-all; }
html {
  word-break: var(--grablo-word-break);
  overflow-wrap: break-word;
}
html:lang(ja),
html:lang(zh) {
  line-break: strict;
  text-wrap-style: pretty;
}
/* 창 제목·설명처럼 내용 폭으로 서는 글 덩이 — 긴 낱말도 상자 안에서 꺾는다(min-content 를 줄인다, D-319). 전역에는 두지 않는다. */
.grablo-wrap-anywhere {
  overflow-wrap: anywhere;
}

html {
  -webkit-text-size-adjust: 100%;
  font-family: var(--grablo-font-sans);
  line-height: 1.5;
  -moz-tab-size: 4;
       tab-size: 4;
  scroll-behavior: auto;
  height: 100%;
}

body {
  font-family: inherit;
  line-height: inherit;
  margin: 0;
  background-color: var(--grablo-surface-page);
}

.vlox-Stepper-steps {
  display: none !important;
}

.blocklyDropDownDiv,
.blocklyWidgetDiv {
  z-index: 9999 !important;
}

/* 배포 헤더 운영중(RUN) 상태 점 맥박 효과 — 점 뒤로 퍼지는 ring.
   라벨 텍스트(점 우측 6px 간격, 중심에서 11.5px)를 침범하지 않도록 최대 1.9배(가장자리 ~10.5px)로 제한.
   끝까지 보이며 서서히 페이드아웃 + 시작 불투명도를 높여 잘 보이게. */
@keyframes grablo-status-pulse {
  0% {
    transform: scale(1);
    opacity: 0.75;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

/* 모션 최소화 선호 시 맥박 정지 (접근성) */
@media (prefers-reduced-motion: reduce) {
  .grablo-status-pulse-ring {
    animation: none !important;
  }
}

/* 커스텀 스크롤바 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--grablo-scrollbar-thumb);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--grablo-scrollbar-thumb-hover);
}

::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--grablo-scrollbar-thumb) transparent;
}

/* 입력 필드가 아닌 곳에서 커서 깜박임 방지 (상속 기반) */
html {
  caret-color: transparent;
}

/* 입력 필드에서는 커서 깜박임 복원 */
input, textarea, [contenteditable="true"], [contenteditable="true"] * {
  caret-color: auto !important;
}
.react-grid-layout {
  position: relative;
  transition: height 200ms ease;
}
.react-grid-item {
  transition: all 200ms ease;
  transition-property: left, top;
}
.react-grid-item img {
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.react-grid-item.cssTransforms {
  transition-property: transform;
}
.react-grid-item.resizing {
  z-index: 9999 !important;
  will-change: width, height;
}

.react-grid-item.react-draggable-dragging {
  transition: none;
  z-index: 9999 !important;
  will-change: transform;
}

.react-grid-item.dropping {
  visibility: hidden;
}

.react-grid-item.react-grid-placeholder {
  background: rgba(0, 0, 0, 0);
  border: 2px;
  border-style: dashed;
  border-radius: 8px;
  opacity: 0.2;
  transition-duration: 100ms;
  z-index: 2;
  -webkit-user-select: none;
  -moz-user-select: none;
  -o-user-select: none;
  user-select: none;
}

.react-grid-item > .react-resizable-handle {
  position: absolute;
  width: 20px;
  height: 20px;
}

.react-grid-item > .react-resizable-handle::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-right: 2px solid rgba(0, 0, 0, 0);
  border-bottom: 2px solid rgba(0, 0, 0, 0);
}

.react-resizable-hide > .react-resizable-handle {
  display: none;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-sw {
  bottom: 0;
  left: 0;
  cursor: sw-resize;
  transform: rotate(90deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-se {
  bottom: 4px;
  right: 4px;
  cursor: se-resize;
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-nw {
  top: 0;
  left: 0;
  cursor: nw-resize;
  transform: rotate(180deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-ne {
  top: 0;
  right: 0;
  cursor: ne-resize;
  transform: rotate(270deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-w,
.react-grid-item > .react-resizable-handle.react-resizable-handle-e {
  top: 50%;
  margin-top: -10px;
  cursor: ew-resize;
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-w {
  left: 0;
  transform: rotate(135deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-e {
  right: 0;
  transform: rotate(315deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-n,
.react-grid-item > .react-resizable-handle.react-resizable-handle-s {
  left: 50%;
  margin-left: -10px;
  cursor: ns-resize;
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-n {
  top: 0;
  transform: rotate(225deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-s {
  bottom: 0;
  transform: rotate(45deg);
}
.react-resizable {
  position: relative;
}
.react-resizable-handle {
  position: absolute;
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-origin: content-box;
  box-sizing: border-box;
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+');
  background-position: bottom right;
  padding: 0 3px 3px 0;
}
.react-resizable-handle-sw {
  bottom: 0;
  left: 0;
  cursor: sw-resize;
  transform: rotate(90deg);
}
.react-resizable-handle-se {
  bottom: 0;
  right: 0;
  cursor: se-resize;
}
.react-resizable-handle-nw {
  top: 0;
  left: 0;
  cursor: nw-resize;
  transform: rotate(180deg);
}
.react-resizable-handle-ne {
  top: 0;
  right: 0;
  cursor: ne-resize;
  transform: rotate(270deg);
}
.react-resizable-handle-w,
.react-resizable-handle-e {
  top: 50%;
  margin-top: -10px;
  cursor: ew-resize;
}
.react-resizable-handle-w {
  left: 0;
  transform: rotate(135deg);
}
.react-resizable-handle-e {
  right: 0;
  transform: rotate(315deg);
}
.react-resizable-handle-n,
.react-resizable-handle-s {
  left: 50%;
  margin-left: -10px;
  cursor: ns-resize;
}
.react-resizable-handle-n {
  top: 0;
  transform: rotate(225deg);
}
.react-resizable-handle-s {
  bottom: 0;
  transform: rotate(45deg);
}

