.kx-editor {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
}

/* 툴바 */
.kx-editor__toolbar {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  background: var(--color-white);
  border-bottom: var(--border-card);
}
.kx-editor__toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.kx-editor__hall {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  color: var(--color-neutral-900);
}
.kx-editor__version {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-caption);
  color: var(--color-neutral-500);
}
.kx-editor__saved::before {
  content: '● ';
  color: var(--color-success);
  font-size: 8px;
}
.kx-editor__degraded {
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  color: var(--color-warning);
  background: #fff4e5;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.kx-editor__toolbar-right {
  display: flex;
  gap: var(--space-2);
}

/* 3열 워크스페이스 */
.kx-editor__workspace {
  flex: 1;
  min-height: 0;
  display: flex;
}
.kx-editor__left {
  width: var(--panel-left-w);
  flex-shrink: 0;
  background: var(--color-white);
  border-right: var(--border-card);
  overflow-y: auto;
}
.kx-editor__right {
  width: var(--panel-right-w);
  flex-shrink: 0;
  background: var(--color-white);
  border-left: var(--border-card);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 좌측 도구 */
.kx-tool-group {
  padding: var(--space-4);
  border-bottom: var(--border-card);
}
.kx-tool-group h3 {
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-neutral-500);
  margin-bottom: var(--space-3);
}
.kx-palette {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.kx-palette__item {
  border: var(--border-card);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  cursor: grab;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.kx-palette__item:hover {
  border-color: var(--color-primary-600);
  background: var(--color-primary-050);
}
.kx-palette__item.is-full {
  grid-column: span 2;
}
.kx-palette__swatch {
  display: block;
  min-width: 20px;
  min-height: 20px;
  border: 1px solid var(--color-primary-600);
  background: rgba(0, 102, 179, 0.15);
}
.kx-palette__item.is-full .kx-palette__swatch {
  width: 100%;
  height: 28px;
}
.kx-palette__label {
  font-size: var(--fs-micro);
  text-align: center;
  color: var(--color-neutral-700);
}
.kx-facility {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.kx-facility button {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border: var(--border-card);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  font-size: var(--fs-body);
  color: var(--color-neutral-700);
}
.kx-facility button:hover {
  background: var(--color-neutral-050);
}

/* 레이어 토글 */
.kx-layer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: var(--fs-body);
  color: var(--color-neutral-700);
}
.kx-switch {
  width: 34px;
  height: 18px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--color-neutral-200);
  position: relative;
  transition: background 0.15s ease;
}
.kx-switch.is-on {
  background: var(--color-primary-600);
}
.kx-switch__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-white);
  transition: left 0.15s ease;
}
.kx-switch.is-on .kx-switch__knob {
  left: 18px;
}

/* 중앙 캔버스 */
.kx-editor__canvas-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-canvas-bg);
}
.kx-editor__canvas-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  overflow: hidden;
}
.kx-editor__canvas-loading {
  width: min(900px, 90%);
}
.kx-editor__canvas-error,
.kx-editor__canvas-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  color: rgba(255, 255, 255, 0.85);
}
.kx-editor__statusbar {
  height: 40px;
  flex-shrink: 0;
  background: var(--color-white);
  border-top: var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  font-size: var(--fs-caption);
  color: var(--color-neutral-500);
}
.kx-editor__stats {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.kx-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-neutral-200);
}
.kx-editor__zoom {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.kx-editor__zoom button {
  width: 24px;
  height: 24px;
  border: var(--border-card);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-neutral-700);
}
.kx-editor__zoom span {
  width: 44px;
  text-align: center;
  font-weight: var(--fw-semibold);
  color: var(--color-neutral-700);
}

/* 우측 탭 */
.kx-editor__tabs {
  display: flex;
  border-bottom: var(--border-card);
  flex-shrink: 0;
}
.kx-editor__tabs button {
  flex: 1;
  padding: var(--space-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  color: var(--color-neutral-500);
}
.kx-editor__tabs button.is-active {
  color: var(--color-primary-600);
  border-bottom-color: var(--color-primary-600);
}

/* 속성 */
.kx-props {
  padding: var(--space-4);
  overflow-y: auto;
}
.kx-props__empty {
  color: var(--color-neutral-500);
  font-size: var(--fs-body);
}
.kx-props__list {
  margin: 0;
}
.kx-props__row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: var(--border-card);
}
.kx-props__row dt {
  color: var(--color-neutral-500);
  font-size: var(--fs-caption);
}
.kx-props__row dd {
  margin: 0;
  color: var(--color-neutral-900);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
}

/* 검증 */
.kx-valid {
  padding: var(--space-4);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  background: var(--color-neutral-050);
  flex: 1;
}
.kx-valid__summary {
  display: flex;
  gap: var(--space-2);
}
.kx-valid__chip {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
}
.kx-valid__chip--block {
  background: #fef3f2;
  color: var(--color-error);
}
.kx-valid__chip--warn {
  background: var(--color-violation-warn-bg);
  color: var(--color-violation-warn-text);
}
.kx-valid__ok {
  background: #e6f4ee;
  color: var(--color-success);
  font-weight: var(--fw-semibold);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body);
}
.kx-valid__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.kx-valid__card {
  display: flex;
  gap: var(--space-3);
  background: var(--color-white);
  border: var(--border-card);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}
.kx-valid__card--block {
  border-left: 3px solid var(--color-error);
}
.kx-valid__card--warn {
  border-left: 3px solid var(--color-violation-warn);
}
.kx-valid__pin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: var(--color-on-accent);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kx-valid__pin--block {
  background: var(--color-error);
}
.kx-valid__pin--warn {
  background: var(--color-violation-warn);
}
.kx-valid__card-body {
  flex: 1;
  min-width: 0;
}
.kx-valid__card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
}
.kx-valid__label {
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  color: var(--color-neutral-900);
}
.kx-valid__locate {
  background: none;
  border: none;
  color: var(--color-primary-600);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  flex-shrink: 0;
}
.kx-valid__measured {
  font-size: var(--fs-caption);
  color: var(--color-neutral-700);
  margin-top: 2px;
}
.kx-valid__doc {
  display: inline-block;
  margin-top: var(--space-2);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  color: var(--color-ai-accent);
  background: var(--color-ai-surface);
  border: 1px solid var(--color-ai-accent);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}
.kx-valid__disclaimer {
  font-size: var(--fs-micro);
  line-height: 15px;
  color: var(--color-neutral-500);
}
